summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2015-10-16 16:44:59 -0700
committerBaruch Sterin <baruchs@gmail.com>2015-10-16 16:44:59 -0700
commitd944384d9e2d39d022fbd338ba99d9b6e7b8e982 (patch)
treec113ab61d3693d44eeb16d2b45c6e9e01e570dd2 /Makefile
parent824584ff44bd121b1817f9475e79c780d3f3e1ae (diff)
downloadabc-d944384d9e2d39d022fbd338ba99d9b6e7b8e982.tar.gz
abc-d944384d9e2d39d022fbd338ba99d9b6e7b8e982.tar.bz2
abc-d944384d9e2d39d022fbd338ba99d9b6e7b8e982.zip
Makefile: add ABC_MAKE_VERBOSE flag to print the acutall commands executed.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 27 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index f82e3a3a..0eeeb00e 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ ifdef ABC_USE_NAMESPACE
endif
# compile CUDD with ABC
-ifdef ABC_USE_CUDD
+ifndef ABC_USE_NO_CUDD
CFLAGS += -DABC_USE_CUDD=1
MODULES += src/bdd/cudd src/bdd/extrab src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/reo src/bdd/cas src/bdd/bbr src/bdd/llb
$(info $(MSG_PREFIX)Compiling with CUDD)
@@ -70,12 +70,26 @@ ifndef ABC_USE_NO_READLINE
endif
# whether to compile with thread support
-ifdef ABC_USE_PTHREADS
+ifdef ABC_USE_NO_PTHREADS
CFLAGS += -DABC_USE_PTHREADS
LIBS += -lpthread
$(info $(MSG_PREFIX)Using pthreads)
endif
+# whether to compile into position independent code
+ifdef ABC_USE_PIC
+ CFLAGS += --fPIC
+ LIBS += -fPIC
+ $(info $(MSG_PREFIX)Compiling position independent code)
+endif
+
+# whether to echo commands while building
+ifdef ABC_MAKE_VERBOSE
+ VERBOSE=
+else
+ VERBOSE=@
+endif
+
# Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only
ifneq ($(or $(findstring gcc,$(CC)),$(findstring g++,$(CC))),)
empty:=
@@ -125,27 +139,27 @@ DEP := $(OBJ:.o=.d)
%.o: %.c
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
- @$(CC) -c $(CFLAGS) $< -o $@
+ $(VERBOSE)$(CC) -c $(CFLAGS) $< -o $@
%.o: %.cc
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
- @$(CXX) -c $(CXXFLAGS) $< -o $@
+ $(VERBOSE)$(CXX) -c $(CXXFLAGS) $< -o $@
%.o: %.cpp
@echo "$(MSG_PREFIX)\`\` Compiling:" $(LOCAL_PATH)/$<
- @$(CXX) -c $(CXXFLAGS) $< -o $@
+ $(VERBOSE)$(CXX) -c $(CXXFLAGS) $< -o $@
%.d: %.c
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
- @./depends.sh $(CC) `dirname $*.c` $(CFLAGS) $*.c > $@
+ $(VERBOSE)./depends.sh $(CC) `dirname $*.c` $(CFLAGS) $*.c > $@
%.d: %.cc
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
- @./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $*.cc > $@
+ $(VERBOSE)./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $*.cc > $@
%.d: %.cpp
@echo "$(MSG_PREFIX)\`\` Generating dependency:" $(LOCAL_PATH)/$<
- @./depends.sh $(CXX) `dirname $*.cpp` $(CXXFLAGS) $*.cpp > $@
+ $(VERBOSE)./depends.sh $(CXX) `dirname $*.cpp` $(CXXFLAGS) $*.cpp > $@
-include $(DEP)
@@ -155,20 +169,20 @@ depend: $(DEP)
clean:
@echo "$(MSG_PREFIX)\`\` Cleaning up..."
- @rm -rvf $(PROG) lib$(PROG).a $(OBJ) $(GARBAGE) $(OBJ:.o=.d)
+ $(VERBOSE)rm -rvf $(PROG) lib$(PROG).a $(OBJ) $(GARBAGE) $(OBJ:.o=.d)
tags:
etags `find . -type f -regex '.*\.\(c\|h\)'`
$(PROG): $(OBJ)
@echo "$(MSG_PREFIX)\`\` Building binary:" $(notdir $@)
- @$(LD) -o $@ $^ $(LIBS)
+ $(VERBOSE)$(LD) -o $@ $^ $(LIBS)
lib$(PROG).a: $(OBJ)
@echo "$(MSG_PREFIX)\`\` Linking:" $(notdir $@)
- @ar rv $@ $?
- @ranlib $@
+ $(VERBOSE)ar rv $@ $?
+ $(VERBOSE)ranlib $@
docs:
@echo "$(MSG_PREFIX)\`\` Building documentation." $(notdir $@)
- @doxygen doxygen.conf
+ $(VERBOSE)doxygen doxygen.conf