forked from HaarigerHarald/omxiv
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (28 loc) · 1.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
OBJS=omxiv.o omx_image.o omx_render.o soft_image.o ./libnsbmp/libnsbmp.o ./libnsgif/libnsgif.o
BIN=omxiv.bin
LDFLAGS+=-lilclient -ljpeg -lpng -lrt -ldl -Wl,--gc-sections -s
INCLUDES+=-I./libnsbmp -I./libnsgif -I./libs/ilclient
INSTALL ?= /usr/local/bin
BUILDVERSION=\"$(shell git rev-parse --short=10 HEAD 2>/dev/null;test $$? -gt 0 && echo UNKNOWN)\"
LIBCURL_NAME=\"$(shell ldconfig -p | grep libcurl | head -n 1 | awk '{print $$1;}' 2>/dev/null)\"
CFLAGS+=-DVERSION=${BUILDVERSION} -DLCURL_NAME=$(LIBCURL_NAME)
include Makefile.include
$(BIN): help.h $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS)
clean::
@rm -f help.h
help.h: README.md
echo -n "static void printUsage(){printf(\"" > help.h
sed -n -e '/\#\# Synopsis/,/\#\# / p' README.md | sed -e '1d;$$d' | sed ':a;N;$$!ba;s/\n/\\n/g' | tr '\n' ' ' >> help.h
echo "\\\\n\");}" >> help.h
ilclient:
mkdir -p libs
cp -ru /opt/vc/src/hello_pi/libs/ilclient libs
make -C libs/ilclient
install:
install -D $(BIN) $(INSTALL)/omxiv
uninstall:
rm -f $(INSTALL)/omxiv
debug: CFLAGS:=$(filter-out -O3,$(CFLAGS)) -Og
debug: LDFLAGS:=$(filter-out -s,$(LDFLAGS))
debug: all