aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2014-06-11 15:13:53 +0200
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2014-06-11 15:13:53 +0200
commit6e9475e4ff1fc79befd5cb6cb72b2fb85ff928af (patch)
treeb6ee42c05f91137821033692322ae0f01e1929d7
parent7e0a8baaf5e9337d26c5d069fe3ba89bd62e3ae4 (diff)
downloadvpb-6e9475e4ff1fc79befd5cb6cb72b2fb85ff928af.tar.gz
makefile: rework to avoid hardcoding file names, and support native compilation
When cross compiling CROSS_COMPILE needs to be set. TODO: This will probably need to be converted to proper autoconf/cmake at some point. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r--Makefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 3eb0fcf..d6d4122 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,15 @@
all: vidctest
-vidctest: queue.o message_queue.o decoder_driver_test.o
- arm-linux-gnueabihf-gcc -pthread queue.o message_queue.o decoder_driver_test.o -o vidctest
+SRC=queue.c message_queue.c decoder_driver_test.c
+OBJ=$(patsubst %.c,%.o,$(SRC))
+CC = $(CROSS_COMPILE)gcc
-queue.o:
- arm-linux-gnueabihf-gcc -c queue.c
+vidctest: $(OBJ)
+ $(CC) -pthread $^ -o $@
-message_queue.o:
- arm-linux-gnueabihf-gcc -c message_queue.c
-
-decoder_driver_test.o:
- arm-linux-gnueabihf-gcc -c decoder_driver_test.c
+%.o: %.c
+ $(CC) -c -o $@ $<
clean:
- -rm -f *.o
+ -rm -f $(OBJ)
-rm -f vidctest