X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2FMakefile;h=e099994e89c59b1445a63c705e84609cc6615a5a;hp=cbf758b4a2abf7914ba8ad7444732e7f7cc56ed0;hb=845b9a98398da56adaa177d73ce7f5a3cfcd1081;hpb=7601d07d77ec207b3984c2d31b69a60021c96dee diff --git a/src/Makefile b/src/Makefile index cbf758b..e099994 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,13 +4,16 @@ PHONY += directories MKDIR_P = mkdir -p OBJ_DIR = bin -C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c) $(wildcard Encoders/*.c) +CPP_SOURCES := $(wildcard *.cc) $(wildcard AST/*.cc) $(wildcard ASTTransform/*.cc) $(wildcard Translator/*.cc) $(wildcard ASTAnalyses/*.cc) $(wildcard ASTAnalyses/Order/*.cc) $(wildcard ASTAnalyses/Encoding/*.cc) $(wildcard ASTAnalyses/Polarity/*.cc) $(wildcard Tuner/*.cc) $(wildcard Collections/*.cc) $(wildcard Backend/*.cc) $(wildcard Encoders/*.cc) -HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard Collections/*.h) $(wildcard Backend/*.h) $(wildcard Encoders/*.h) +C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard ASTTransform/*.c) $(wildcard Translator/*.c) $(wildcard ASTAnalyses/*.c) $(wildcard ASTAnalyses/Order/*.c) $(wildcard ASTAnalyses/Encoding/*.c) $(wildcard ASTAnalyses/Polarity/*.c) $(wildcard Tuner/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c) $(wildcard Encoders/*.c) + +HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard ASTTransform/*.h) $(wildcard Translator/*.h) $(wildcard ASTAnalyses/*.h) $(wildcard ASTAnalyses/Order/*.h) $(wildcard ASTAnalyses/Encoding/*.h) $(wildcard ASTAnalyses/Polarity/*.h) $(wildcard Tuner/*.h) $(wildcard Collections/*.h) $(wildcard Backend/*.h) $(wildcard Encoders/*.h) OBJECTS := $(CPP_SOURCES:%.cc=$(OBJ_DIR)/%.o) $(C_SOURCES:%.c=$(OBJ_DIR)/%.o) -CFLAGS += -IAST -ICollections -IBackend -I. -IEncoders +CFLAGS := -Wall -g -O0 +CFLAGS += -IAST -IASTTransform -IASTAnalyses -IASTAnalyses/Polarity -IASTAnalyses/Order -IASTAnalyses/Encoding -ITranslator -ICollections -IBackend -I. -IEncoders -ITuner LDFLAGS := -ldl -lrt -rdynamic SHARED := -shared @@ -22,13 +25,20 @@ endif MARKDOWN := ../docs/Markdown/Markdown.pl -all: directories $(LIB_SO) +all: directories ${OBJ_DIR}/$(LIB_SO) directories: ${OBJ_DIR} ${OBJ_DIR}: ${MKDIR_P} ${OBJ_DIR} ${MKDIR_P} ${OBJ_DIR}/AST + ${MKDIR_P} ${OBJ_DIR}/ASTAnalyses + ${MKDIR_P} ${OBJ_DIR}/ASTAnalyses/Order + ${MKDIR_P} ${OBJ_DIR}/ASTAnalyses/Encoding + ${MKDIR_P} ${OBJ_DIR}/ASTAnalyses/Polarity + ${MKDIR_P} ${OBJ_DIR}/ASTTransform + ${MKDIR_P} ${OBJ_DIR}/Translator + ${MKDIR_P} ${OBJ_DIR}/Tuner ${MKDIR_P} ${OBJ_DIR}/Collections ${MKDIR_P} ${OBJ_DIR}/Backend ${MKDIR_P} ${OBJ_DIR}/Encoders @@ -36,12 +46,18 @@ ${OBJ_DIR}: debug: CFLAGS += -DCONFIG_DEBUG debug: all +test: all + make -C Test + PHONY += docs docs: $(C_SOURCES) $(HEADERS) doxygen -$(LIB_SO): $(OBJECTS) - $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS) +${OBJ_DIR}/$(LIB_SO): $(OBJECTS) + $(CXX) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS) + +${OBJ_DIR}/%.o: %.cc + $(CXX) -fPIC -c $< -o $@ $(CFLAGS) -Wno-unused-variable ${OBJ_DIR}/%.o: %.c $(CC) -fPIC -c $< -o $@ $(CFLAGS) -Wno-unused-variable @@ -62,10 +78,10 @@ tags: ctags -R tabbing: - uncrustify -c C.cfg --no-backup *.c - uncrustify -c C.cfg --no-backup *.h */*.h + uncrustify -c C.cfg --no-backup *.cc */*.cc */*/*.cc + uncrustify -c C.cfg --no-backup *.h */*.h */*/*.h wc: - wc */*.c */*.h *.c *.h + wc */*.cc */*.h *.cc *.h */*/*.cc */*/*.h .PHONY: $(PHONY)