edid-decode: fix EDID 1.4 Aspect Ratio calculation
[edid-decode.git] / Makefile
blobcb85fc0e1650eb80970ba17d3b41c51fd9b5cfd7
1 bindir ?= /usr/bin
2 mandir ?= /usr/share/man
4 EMXX ?= em++
6 SOURCES = edid-decode.cpp parse-base-block.cpp parse-cta-block.cpp \
7 parse-displayid-block.cpp parse-ls-ext-block.cpp \
8 parse-di-ext-block.cpp parse-vtb-ext-block.cpp
9 WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
11 all: edid-decode
13 sha = -DSHA=$(shell if test -d .git ; then git rev-parse --short=12 HEAD ; fi)
14 date = -DDATE=$(shell if test -d .git ; then printf '"'; TZ=UTC git show --quiet --date='format-local:%F %T"' --format="%cd"; fi)
16 edid-decode: $(SOURCES) edid-decode.h Makefile
17 $(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) $(date) -o $@ $(SOURCES) -lm
19 edid-decode.js: $(SOURCES) edid-decode.h Makefile
20 $(EMXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) $(sha) $(date) -s EXPORTED_FUNCTIONS='["_parse_edid"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -o $@ $(SOURCES) -lm
22 clean:
23 rm -f edid-decode
25 install:
26 mkdir -p $(DESTDIR)$(bindir)
27 install -m 0755 edid-decode $(DESTDIR)$(bindir)
28 mkdir -p $(DESTDIR)$(mandir)/man1
29 install -m 0644 edid-decode.1 $(DESTDIR)$(mandir)/man1