From 7bbaf432e657417a31e83ea542eeba2b68150250 Mon Sep 17 00:00:00 2001 From: whoami Date: Wed, 17 Jul 2019 21:11:53 +0300 Subject: [PATCH] Makefile: ability to compile thirdparty libraries (for linux packages) --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3908eafb34..702908c74d 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ +CC ?= cc +CFLAGS ?= -fPIC -O2 + all: clean v $(info V has been successfully built) v: v.c - cc -std=gnu11 -w -o v v.c -lm + ${CC} -std=gnu11 -w -o v v.c -lm ./v -o v compiler rm v.c @@ -17,4 +20,9 @@ test: v find examples -name '*.v' -not -path "examples/hot_code_reloading/*" -print0 | xargs -0 -n1 ./v clean: - -rm -f v.c v vprod + -rm -f v.c .v.c v vprod thirdparty/**/*.o + +SOURCES = $(wildcard thirdparty/**/*.c) +OBJECTS := ${SOURCES:.c=.o} + +thirdparty: ${OBJECTS}