summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index dfe7230..9633fad 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,12 @@
-CC=arm-linux-gnueabihf-gcc
-CFLAGS=-Wall -Wextra -I. -IImageMagick
-LDFLAGS=-lpthread -LImageMagick/MagickCore/.libs
-LDLIBS=-lMagickCore-7.Q8 -lm
+CROSS=arm-linux-gnueabihf
+DEPLIBS=MagickCore libpng16 zlib
+PKGCONFIG=PKG_CONFIG_PATH=/usr/$(CROSS)/lib/pkgconfig pkg-config
+CC=$(CROSS)-gcc
+CFLAGS=-Wall -Wextra -I. $$($(PKGCONFIG) --cflags MagickCore)
+LDFLAGS=-lpthread $$($(PKGCONFIG) --libs-only-L $(DEPLIBS))
+LDLIBS=$$($(PKGCONFIG) --libs-only-l $(DEPLIBS)) -lm
+
+all: install-deps freeonebook
freeonebook: freeonebook.o gpio.o fb.o convert.o
@@ -15,3 +20,9 @@ convert.o: convert.c convert.h
clean:
rm -f freeonebook *.o
+
+install-deps: deps.installed
+
+deps.installed:
+ cd deps; $(MAKE) all
+ touch $@