From 3c8d024bdb7ba6c51ee4be31294e1024ec4d818a Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 26 Jun 2017 22:45:09 +0200 Subject: [PATCH] configurable makefile vars from command line - OUT and INCZ can be set in command line - DEFS can be set via CC_EXTRA_FLAGS - use the vars in sqstdlib makefile --- sqstdlib/Makefile | 12 +++++++----- squirrel/Makefile | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sqstdlib/Makefile b/sqstdlib/Makefile index ff29f4f..4d6cd6a 100644 --- a/sqstdlib/Makefile +++ b/sqstdlib/Makefile @@ -1,8 +1,10 @@ SQUIRREL= .. -OUT= $(SQUIRREL)/lib/libsqstdlib.a -INCZ= -I$(SQUIRREL)/include -I. -Iinclude +OUT?= $(SQUIRREL)/lib/libsqstdlib.a +INCZ?= -I$(SQUIRREL)/include -I. -Iinclude +DEFS= $(CC_EXTRA_FLAGS) +LIB= OBJS= \ sqstdblob.o \ @@ -26,16 +28,16 @@ SRCS= \ sq32: - gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) + gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS) ar rc $(OUT) *.o rm *.o sqprof: - gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) + gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS) ar rc $(OUT) *.o rm *.o sq64: - gcc -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) + gcc -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS) ar rc $(OUT) *.o rm *.o diff --git a/squirrel/Makefile b/squirrel/Makefile index 10dd365..b1fb625 100644 --- a/squirrel/Makefile +++ b/squirrel/Makefile @@ -1,9 +1,9 @@ SQUIRREL= .. -OUT= $(SQUIRREL)/lib/libsquirrel.a -INCZ= -I$(SQUIRREL)/include -I. -Iinclude -DEFS= +OUT?= $(SQUIRREL)/lib/libsquirrel.a +INCZ?= -I$(SQUIRREL)/include -I. -Iinclude +DEFS= $(CC_EXTRA_FLAGS) LIB= OBJS= \