Browse Source

Fix make files to work with extra parameters

mingodad 7 years ago
parent
commit
a6fbe44064
4 changed files with 16 additions and 9 deletions
  1. 4 1
      SquiLu/Makefile
  2. 5 4
      SquiLu/sq/Makefile
  3. 5 3
      SquiLu/sqstdlib/Makefile
  4. 2 1
      SquiLu/squirrel/Makefile

+ 4 - 1
SquiLu/Makefile

@@ -1,6 +1,9 @@
 
 SQUIRREL=.
-MAKE=make
+MAKE=make CC=g++ CC_EXTRA_FLAGS="-flto -DNDEBUG -DONLY_ASCII -DNO_ABSTRACT_METHOD -DCUSTOM_DELETE_OPERATOR -DSQ_USE_MKSTEMP  -DSQ_ENABLE_INCLUDES -DSQ_SUBLATIN -DNEED_SUBLATIN_C -DSQUSEDOUBLE" \
+	LD_EXTRA_FLAGS="-flto"
+#MAKE=make CC=g++ CC_EXTRA_FLAGS="-fsanitize=address -DONLY_ASCII -DSQ_USE_MKSTEMP -DSQ_ENABLE_INCLUDES -DSQ_SUBLATIN -DNEED_SUBLATIN_C -DSQUSEDOUBLE"
+#MAKE=make
 
 DIRS=bin lib
 $(shell mkdir -p $(DIRS))

+ 5 - 4
SquiLu/sq/Makefile

@@ -4,7 +4,7 @@ SQUIRREL= ..
 OUT= $(SQUIRREL)/bin/sq
 INCZ= -I$(SQUIRREL)/include -I. -I$(SQUIRREL)/sqlibs -DNO_EXCEPTION_KEY_NOT_FOUND22=1
 LIBZ= -L$(SQUIRREL)/lib 
-LIB= -lsquirrel -lsqstdlib
+LIB= -lsquirrel -lsqstdlib -lm $(LD_EXTRA_FLAGS)
 
 OBJS= sq.o
 	
@@ -12,10 +12,11 @@ SRCS= sq.c
 	
 	
 sq32:
-	g++ -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+	g++ -O2 -s -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
 
 sqprof:
-	g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+	g++ -O2 -pg  -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
 	
 sq64:
-	g++ -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+	g++ -O2 -s -m64 -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
+#	g++ -g -m64 -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)

+ 5 - 3
SquiLu/sqstdlib/Makefile

@@ -3,6 +3,7 @@ SQUIRREL= ..
 
 OUT= $(SQUIRREL)/lib/libsqstdlib.a
 INCZ= -I$(SQUIRREL)/include -I. -Iinclude
+DEFS= $(CC_EXTRA_FLAGS) $(LD_EXTRA_FLAGS)
 
 OBJS= \
 	sqstdblob.o \
@@ -26,16 +27,17 @@ SRCS= \
 	
 	
 sq32:
-	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	$(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
 	ar rc $(OUT) *.o
 	rm *.o
 
 sqprof:
-	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	$(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
 	ar rc $(OUT) *.o
 	rm *.o
 	
 sq64:
-	$(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
+	$(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
+#	$(CC) -g -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
 	ar rc $(OUT) *.o
 	rm *.o

+ 2 - 1
SquiLu/squirrel/Makefile

@@ -3,7 +3,7 @@ SQUIRREL= ..
 
 OUT= $(SQUIRREL)/lib/libsquirrel.a
 INCZ= -I$(SQUIRREL)/include -I. -Iinclude -I$(SQUIRREL)/sqstdlib
-DEFS= -DSQ_ENABLE_INCLUDES -DSQ_SUBLATIN -DNEED_SUBLATIN_C -DSQUSEDOUBLE
+DEFS= $(CC_EXTRA_FLAGS)
 LIB=	
 
 OBJS= \
@@ -52,5 +52,6 @@ sqprof:
 
 sq64:
 	$(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
+#	$(CC) -g -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
 	ar rc $(OUT) *.o
 	rm *.o