From 6c6528e3a508c8ab357b58e9744dd86ebf3e6914 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 12 Nov 2018 20:21:52 -0500 Subject: automate dependency building --- Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 $@ -- cgit v1.2.1