summaryrefslogtreecommitdiff
path: root/make.defs
diff options
context:
space:
mode:
Diffstat (limited to 'make.defs')
-rw-r--r--make.defs38
1 files changed, 15 insertions, 23 deletions
diff --git a/make.defs b/make.defs
index b9bc3fb..6f648e3 100644
--- a/make.defs
+++ b/make.defs
@@ -1,28 +1,20 @@
-# Definitions for our funky-chicken build system
+# defaults
+CC = gcc
+CFLAGS = -pipe -g -fno-strict-aliasing -Wall -Wextra -Werror=all -Werror=implicit-function-declaration
+CP = cp -f
+# The below might cause problems sometimes
+# CP = cp -lf
+# CP = cp -sf
-ifeq ($(shell uname -m), x86_64)
-M32=-m32
-endif
-
-CC = gcc ${M32}
-LEX=flex
-BISON=bison
-
-PLATFORM = $(shell uname)
-ifeq ($(findstring FreeBSD,$(PLATFORM)), FreeBSD)
-MAKE = gmake
-else
-MAKE = make
-endif
-
-OPT = -pipe -g -fno-strict-aliasing -O2 -Wall
+# works on both x86 and x86_64
+override CC += -m32 -std=gnu99
-ifeq ($(findstring CYGWIN,$(PLATFORM)), CYGWIN)
-OS_TYPE = -DCYGWIN
-CFLAGS = $(OPT) -DFD_SETSIZE=4096 -I../common $(PACKETDEF) $(OS_TYPE)
+ifeq ($(findstring CYGWIN,$(shell uname)), CYGWIN)
+ override CFLAGS += -DFD_SETSIZE=4096 -DCYGWIN
else
-OS_TYPE =
-CFLAGS = $(OPT) -fstack-protector -Wno-pointer-sign -I../common $(PACKETDEF) $(OS_TYPE)
+ override CFLAGS += -fstack-protector
endif
+# The default recipe is suboptimal
+%.c: %.l
+ $(LEX) -o $@ $<
-MKDEF = CC="$(CC)" CFLAGS="$(CFLAGS)"