diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-19 22:15:55 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-19 22:15:55 -0700 |
commit | f3bab3e479ab1ef2e07f5922f8ffd3c9c9214717 (patch) | |
tree | 53f2caf66bf94ba20b8aa2d908846b451db720ee /Makefile | |
parent | 1e34a38b1666ee94cd4441c4889bb412bc813eba (diff) | |
download | abc-f3bab3e479ab1ef2e07f5922f8ffd3c9c9214717.tar.gz abc-f3bab3e479ab1ef2e07f5922f8ffd3c9c9214717.tar.bz2 abc-f3bab3e479ab1ef2e07f5922f8ffd3c9c9214717.zip |
Updated Makefile as suggested by Mark Jarvin.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 36 |
1 files changed, 28 insertions, 8 deletions
@@ -1,11 +1,15 @@ -CC := gcc +CC := g++ CXX := g++ -LD := g++ +LD := $(CXX) + +$(info Using CC=$(CC)) +$(info Using CXX=$(CXX)) +$(info Using LD=$(LD)) PROG := abc MODULES := \ - $(wildcard src/ext) src/misc/ext \ + $(wildcard src/ext) src/misc/ext \ src/base/abc src/base/abci src/base/cmd src/base/io \ src/base/main src/base/ver src/base/test \ src/bdd/cudd src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/parse \ @@ -36,12 +40,27 @@ arch_flags : arch_flags.c ARCHFLAGS := $(shell $(CC) arch_flags.c -o arch_flags && ./arch_flags) OPTFLAGS := -g -O #-DABC_NAMESPACE=xxx -CFLAGS += -Wall -Wno-unused-function $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src +CFLAGS += -Wall -Wno-unused-function -Wno-write-strings -Wno-sign-compare $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src + +# Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only +ifneq ($(or $(findstring gcc,$(CC)),$(findstring g++,$(CC))),) +empty:= +space:=$(empty) $(empty) -#ifeq ($(shell $(CC) -dumpversion | awk '{FS="."; print ($$1>=4 && $$2>=6)}'),1) -# Set -Wno-unused-but-set-variable for GCC 4.6.0 and greater only +GCC_VERSION=$(shell $(CC) -dumpversion) +GCC_MAJOR=$(word 1,$(subst .,$(space),$(GCC_VERSION))) +GCC_MINOR=$(word 2,$(subst .,$(space),$(GCC_VERSION))) + +$(info Found GCC_VERSION $(GCC_VERSION)) +ifeq ($(findstring $(GCC_MAJOR),0 1 2 3),) +$(info Found GCC_MAJOR>=4) +ifeq ($(findstring $(GCC_MINOR),0 1 2 3 4 5),) +$(info Found GCC_MINOR>=6) CFLAGS += -Wno-unused-but-set-variable -#endif +endif +endif + +endif LIBS := -ldl @@ -55,12 +74,13 @@ CFLAGS += -DABC_USE_PTHREADS LIBS += -lpthread endif +$(info Using CFLAGS=$(CFLAGS)) CXXFLAGS += $(CFLAGS) SRC := GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags -.PHONY: tags clean docs +.PHONY: all default tags clean docs include $(patsubst %, %/module.make, $(MODULES)) |