]> git.zerfleddert.de Git - hmcfgusb/blobdiff - Makefile
Allow the user to specify the compiler via environment variable
[hmcfgusb] / Makefile
index ffe96736c1b2d204968b7452101f50282324e970..bb05507603af48012a4d7bea492eecfbd4713703 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,42 @@
 ifeq ($(OPENWRT_BUILD),)
 
 #Normal system
-CFLAGS=-MMD -O2 -Wall -I/opt/local/include -g
-LDFLAGS=-L/opt/local/lib
-LDLIBS=-lusb-1.0 -lrt
-CC=gcc
+CFLAGS=-Wall -Wextra -Wno-unused-parameter -pedantic
+CFLAGS+= -Wno-unknown-warning-option
+CFLAGS+= -Wformat=2
+CFLAGS+= -Wformat-truncation=2
+CFLAGS+= -Wwrite-strings
+CFLAGS+= -Wnull-dereference
+CFLAGS+= -Wuninitialized
+CFLAGS+= -Wstrict-overflow
+CFLAGS+= -Wdate-time
+CFLAGS+= -Wundef
+CFLAGS+= -Wpacked
+CFLAGS+= -Wduplicated-branches
+CFLAGS+= -Wduplicated-cond
+CFLAGS+= -Wstrict-prototypes
+CFLAGS+= -Wbad-function-cast
+CFLAGS+= -Wold-style-definition
+CFLAGS+= -MMD -O2 -I/opt/local/include -g
+
+LDFLAGS:=-L/opt/local/lib
+LDLIBS:=-lusb-1.0 -lrt
+
+ifeq ($(firstword $(origin CC)),default)
+CC:=gcc
+endif
 
-HMLAN_OBJS=hmcfgusb.o hmland.o util.o
-HMSNIFF_OBJS=hmcfgusb.o hmuartlgw.o hmsniff.o
-FLASH_HMCFGUSB_OBJS=hmcfgusb.o firmware.o util.o flash-hmcfgusb.o
-FLASH_HMMODUART_OBJS=hmuartlgw.o firmware.o util.o flash-hmmoduart.o
-FLASH_OTA_OBJS=hmcfgusb.o culfw.o hmuartlgw.o firmware.o util.o flash-ota.o hm.o aes.o
+HMLAN_OBJS:=hmcfgusb.o hmland.o util.o
+HMSNIFF_OBJS:=hmcfgusb.o hmuartlgw.o hmsniff.o
+FLASH_HMCFGUSB_OBJS:=hmcfgusb.o firmware.o util.o flash-hmcfgusb.o
+FLASH_HMMODUART_OBJS:=hmuartlgw.o firmware.o util.o flash-hmmoduart.o
+FLASH_OTA_OBJS:=hmcfgusb.o culfw.o hmuartlgw.o firmware.o util.o flash-ota.o hm.o aes.o
 
-OBJS=$(HMLAN_OBJS) $(HMSNIFF_OBJS) $(FLASH_HMCFGUSB_OBJS) $(FLASH_HMMODUART_OBJS) $(FLASH_OTA_OBJS)
+OBJS:=$(HMLAN_OBJS) $(HMSNIFF_OBJS) $(FLASH_HMCFGUSB_OBJS) $(FLASH_HMMODUART_OBJS) $(FLASH_OTA_OBJS)
 
 all: hmland hmsniff flash-hmcfgusb flash-hmmoduart flash-ota
 
-DEPEND=$(OBJS:.o=.d)
+DEPEND:=$(OBJS:.o=.d)
 -include $(DEPEND)
 
 hmland: $(HMLAN_OBJS)
Impressum, Datenschutz