1 ifeq ($(OS
),Windows_NT
)
3 mandir ?
= /usr
/share
/man
5 UNAME_S
:= $(shell uname
-s
)
6 ifeq ($(UNAME_S
),Darwin
)
7 bindir ?
= /usr
/local
/sbin
8 mandir ?
= /usr
/local
/share
/man
11 mandir ?
= /usr
/share
/man
17 SOURCES
= edid-decode.
cpp parse-base-block.
cpp parse-cta-block.
cpp \
18 parse-displayid-block.
cpp parse-ls-ext-block.
cpp \
19 parse-di-ext-block.
cpp parse-vtb-ext-block.
cpp \
20 calc-gtf-cvt.
cpp calc-ovt.
cpp
21 WARN_FLAGS
= -Wall
-Wextra
-Wno-missing-field-initializers
-Wno-unused-parameter
-Wimplicit-fallthrough
25 sha
= -DSHA
=$(shell if
test -d .git
; then git rev-parse
--short
=12 HEAD
; fi
)
26 date
= -DDATE
=$(shell if
test -d .git
; then TZ
=UTC git show
--quiet
--date
='format-local:"%F %T"' --format
='%cd'; fi
)
28 edid-decode
: $(SOURCES
) edid-decode.h oui.h Makefile
29 $(CXX
) $(CPPFLAGS
) $(CFLAGS
) $(LDFLAGS
) $(WARN_FLAGS
) -g
$(sha
) $(date
) -o
$@
$(SOURCES
) -lm
31 edid-decode.js
: $(SOURCES
) edid-decode.h oui.h Makefile
32 $(EMXX
) $(CPPFLAGS
) $(CFLAGS
) $(LDFLAGS
) $(WARN_FLAGS
) $(sha
) $(date
) -s EXPORTED_FUNCTIONS
='["_parse_edid"]' -s EXPORTED_RUNTIME_METHODS
='["ccall", "cwrap"]' -o
$@
$(SOURCES
) -lm
35 rm -f edid-decode edid-decode.js edid-decode.wasm
38 mkdir
-p
$(DESTDIR
)$(bindir)
39 install -m
0755 edid-decode
$(DESTDIR
)$(bindir)
40 mkdir
-p
$(DESTDIR
)$(mandir)/man1
41 install -m
0644 edid-decode
.1 $(DESTDIR
)$(mandir)/man1