diff options
-rw-r--r-- | Cmds | 7 | ||||
-rw-r--r-- | INSTALL | 1 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | Misc | 1 | ||||
-rw-r--r-- | Template | 1 |
5 files changed, 13 insertions, 0 deletions
@@ -14,6 +14,13 @@ else STRIP = $(Q)echo -e " STRIP\t$@" && $(CROSS_COMPILE)strip endif +# sparse related +ifeq ($(C), 1) + CHECK = $(Q)echo -e " CHECK\t$<" && sparse +else + CHECK = $(Q)true +endif + # Flex/bison related LEX = $(Q)echo -e " LEX\t$<" && flex YAAC = $(Q)echo -e " YAAC\t$<" && bison @@ -13,6 +13,7 @@ What additional tools next to your build-chain are required? - ccache (optional) - gpg (optional) + - sparse (optional) - pkg-config: all - flex, bison: bpfc, trafgen @@ -107,6 +107,9 @@ ifeq ("$(origin CROSS_LD_LIBRARY_PATH)", "command line") LDFLAGS += -L$(CROSS_LD_LIBRARY_PATH) endif +CHECKFLAGS = -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix \ + -Wbitwise -Wnoreturn-void + VERSION_SHORT = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) VERSION_STRING = "$(VERSION_SHORT)$(CONFIG_RC)" VERSION_LONG = "$(VERSION_SHORT)$(CONFIG_RC) ($(NAME))" @@ -114,4 +114,5 @@ help: $(Q)echo " CPPFLAGS=\"-I <path> ...\" - Additional CFLAGS for compilation" $(Q)echo " LDFLAGS=\"-L <path> ...\" - Additional LDFLAGS for compilation" $(Q)echo " CCACHE= - Do not use ccache for compilation" + $(Q)echo " C=1 - Check all C source files with sparse" $(Q)echo " Q= - Show verbose garbage" @@ -21,5 +21,6 @@ define TOOL_templ $(1)/%.tab.o: $(1)/%.tab.c $$(CC) $$(CFLAGS) -o $$@ -c $$< $(1)/%.o: %.c + $$(CHECK) $$(CFLAGS) $$(CHECKFLAGS) $$< $$(CC) $$(CFLAGS) -o $(1)/$$(shell basename $$@) -c $$< endef |