summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-04 11:10:25 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-04 11:10:25 -0700
commit36d5ef4e6239b51cebc46229ab977696f0152d83 (patch)
tree08e3fbc164544a4f661a2eb3d6c09254888648fe /Makefile
parent95571be5036ac760e82ee86f4faf2418a5a23a32 (diff)
downloadabc-36d5ef4e6239b51cebc46229ab977696f0152d83.tar.gz
abc-36d5ef4e6239b51cebc46229ab977696f0152d83.tar.bz2
abc-36d5ef4e6239b51cebc46229ab977696f0152d83.zip
Making changes suggested by Mark Jarvin.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 21 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 4247a799..e9214359 100644
--- a/Makefile
+++ b/Makefile
@@ -37,11 +37,26 @@ 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 -Wno-unused-but-set-variable $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src
-CXXFLAGS += $(CFLAGS)
+CFLAGS += -Wall -Wno-unused-function $(OPTFLAGS) $(ARCHFLAGS) -I$(PWD)/src
+
+ifeq ($(shell $(CC) -dumpversion | awk '{FS="."; print ($$1>=4 && $$2>=6)}'),1)
+# Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only
+CFLAGS += -Wno-unused-but-set-variable
+endif
+
+LIBS := -ldl
-#LIBS := -m32 -ldl -rdynamic -lreadline -ltermcap
-LIBS := -ldl -lreadline -lpthread
+ifneq ($(READLINE),0)
+CFLAGS += -DABC_USE_READLINE
+LIBS += -lreadline
+endif
+
+ifneq ($(PTHREADS),0)
+CFLAGS += -DABC_USE_PTHREADS
+LIBS += -lpthread
+endif
+
+CXXFLAGS += $(CFLAGS)
SRC :=
GARBAGE := core core.* *.stackdump ./tags $(PROG) arch_flags
@@ -65,7 +80,7 @@ DEP := $(OBJ:.o=.d)
%.o: %.cc
@echo "\`\` Compiling:" $(LOCAL_PATH)/$<
- @$(CC) -c $(CXXFLAGS) $< -o $@
+ @$(CXX) -c $(CXXFLAGS) $< -o $@
%.d: %.c
@echo "\`\` Dependency:" $(LOCAL_PATH)/$<
@@ -73,7 +88,7 @@ DEP := $(OBJ:.o=.d)
%.d: %.cc
@echo "\`\` Generating dependency:" $(LOCAL_PATH)/$<
- @./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $(CFLAGS) $*.cc > $@
+ @./depends.sh $(CXX) `dirname $*.cc` $(CXXFLAGS) $*.cc > $@
-include $(DEP)