Use EXTRA_CFLAGS intead of CFLAGS. Remove -Werror
[madwifi/.git] / Makefile.inc
index 9a911b3d9a8da2acc1a94668c3a2141d9ef2754d..9c4ab3a70f1b913d8a2ab269379064b5fb36b91b 100644 (file)
@@ -161,12 +161,53 @@ TARGETS=$(basename $(notdir $(wildcard $(HAL)/public/*.inc)))
 $(error TARGET $(TARGET) is invalid, valid targets are: $(TARGETS))
 endif
 
+ifndef ATH_DEBUG_SPINLOCKS
+export ATH_DEBUG_SPINLOCKS=0
+endif
+
+ifndef IEEE80211_DEBUG_REFCNT
+export IEEE80211_DEBUG_REFCNT=0
+endif
+
+ifndef HAL_DEBUG
+export HAL_DEBUG=0
+endif
+
+ifndef ALQ
+export ALQ=0
+endif
+
+ifndef ATH_DEBUG
+export ATH_DEBUG=1
+endif
+
+ifndef MMIOTRACE
+export MMIOTRACE=0
+endif
+
+ifeq ($(strip $(MMIOTRACE)),1)
+EXTRA_CFLAGS += -DMMIOTRACE=1
+endif
+
+ifeq ($(strip $(ATH_DEBUG_SPINLOCKS)),1)
+COPTS+= -DATH_DEBUG_SPINLOCKS=1
+endif
+
+ifeq ($(strip $(IEEE80211_DEBUG_REFCNT)),1)
+COPTS+= -DIEEE80211_DEBUG_REFCNT=1
+endif
+
 # HAL_DEBUG enables HAL debugging code
 # At the moment this consists of wrappers around HAL functions so that 
 # stack traces are more decipherable.
+ifeq ($(strip $(HAL_DEBUG)),1)
+COPTS+= -fno-inline -DAH_DEBUG=1
+endif
 
-ifdef HAL_DEBUG
-COPTS+= -fno-inline
+ifeq ($(strip $(ALQ)),1)
+obj-m += alq.o
+alq-objs := kern_alq.o
+EXTRA_CFLAGS += -DAH_DEBUG_ALQ -DAH_DEBUG
 endif
 
 # Don't let HAL mess with the toolchain - save toolchain variables
@@ -187,13 +228,28 @@ NM := $(save_NM)
 
 include $(TOP)/BuildCaps.inc
 
+ifeq ($(strip $(ATH_DEBUG)),1)
+EXTRA_CFLAGS += -DAR_DEBUG -DIEEE80211_DEBUG 
+endif
+
+ifeq ($(strip $(ATH_DEBUG_SPINLOCKS)),1)
+EXTRA_CFLAGS += -DATH_DEBUG_SPINLOCKS
+endif
+
+ifeq ($(strip $(IEEE80211_DEBUG_REFCNT)),1)
+EXTRA_CFLAGS += -DIEEE80211_DEBUG_REFCNT
+endif
+
 # Ensure correct endianess
 LDFLAGS += $(LDOPTS)
 
+# Be pedantic
+EXTRA_CFLAGS += -Wall
+
 # Filter out compiler options that are not supported by all compilers
 # and that are not needed to ensure compatible architecture and calling
 # conventions.
-COPTS := $(filter-out -mshort-load-bytes,$(COPTS))
+COPTS := $(filter-out -mshort-load-bytes -mapcs-32,$(COPTS))
 
 
 # The following variables will affect developers only, and are used in the