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
This commit is contained in:
Daniel-Constantin Mierla 2017-06-26 22:45:09 +02:00
parent 2186a3fe21
commit 3c8d024bdb
2 changed files with 10 additions and 8 deletions

View File

@ -1,8 +1,10 @@
SQUIRREL= .. SQUIRREL= ..
OUT= $(SQUIRREL)/lib/libsqstdlib.a OUT?= $(SQUIRREL)/lib/libsqstdlib.a
INCZ= -I$(SQUIRREL)/include -I. -Iinclude INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= $(CC_EXTRA_FLAGS)
LIB=
OBJS= \ OBJS= \
sqstdblob.o \ sqstdblob.o \
@ -26,16 +28,16 @@ SRCS= \
sq32: 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 ar rc $(OUT) *.o
rm *.o rm *.o
sqprof: 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 ar rc $(OUT) *.o
rm *.o rm *.o
sq64: 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 ar rc $(OUT) *.o
rm *.o rm *.o

View File

@ -1,9 +1,9 @@
SQUIRREL= .. SQUIRREL= ..
OUT= $(SQUIRREL)/lib/libsquirrel.a OUT?= $(SQUIRREL)/lib/libsquirrel.a
INCZ= -I$(SQUIRREL)/include -I. -Iinclude INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= DEFS= $(CC_EXTRA_FLAGS)
LIB= LIB=
OBJS= \ OBJS= \