X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=blobdiff_plain;f=src%2FMakefile;h=431d55b037d997c7f245883d0dc27a052f33429e;hp=548189ef94762759b635481cfc31d02d5e8b8efc;hb=b373ca39ded747fb61eda999a28dc178a6bb5eaa;hpb=8ff6e4e82904508f93decb9f8b57cb084f5f6e65 diff --git a/src/Makefile b/src/Makefile index 548189e..431d55b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,11 +4,14 @@ PHONY += directories MKDIR_P = mkdir -p OBJ_DIR = bin -CPP_SOURCES := constraint.cc inc_solver.cc set.cc mutableset.cc element.cc function.cc order.cc table.cc predicate.cc boolean.cc csolver.cc +C_SOURCES := $(wildcard *.c) $(wildcard AST/*.c) $(wildcard Collections/*.c) $(wildcard Backend/*.c) $(wildcard Encoders/*.c) + +HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard Collections/*.h) $(wildcard Backend/*.h) $(wildcard Encoders/*.h) OBJECTS := $(CPP_SOURCES:%.cc=$(OBJ_DIR)/%.o) $(C_SOURCES:%.c=$(OBJ_DIR)/%.o) -CPPFLAGS += -Iinclude -I. +CFLAGS := -Wall -g -O0 +CFLAGS += -IAST -ICollections -IBackend -I. -IEncoders LDFLAGS := -ldl -lrt -rdynamic SHARED := -shared @@ -26,25 +29,23 @@ directories: ${OBJ_DIR} ${OBJ_DIR}: ${MKDIR_P} ${OBJ_DIR} + ${MKDIR_P} ${OBJ_DIR}/AST + ${MKDIR_P} ${OBJ_DIR}/Collections + ${MKDIR_P} ${OBJ_DIR}/Backend + ${MKDIR_P} ${OBJ_DIR}/Encoders -debug: CPPFLAGS += -DCONFIG_DEBUG +debug: CFLAGS += -DCONFIG_DEBUG debug: all PHONY += docs -docs: *.cc *.h +docs: $(C_SOURCES) $(HEADERS) doxygen $(LIB_SO): $(OBJECTS) - $(CXX) -g $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS) + $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS) ${OBJ_DIR}/%.o: %.c - $(CC) -fPIC -c $< -o $@ $(CPPFLAGS) -Wno-unused-variable - -${OBJ_DIR}/%.o: %.cc - $(CXX) -MMD -MF $@.d -o $@ -fPIC -c $< $(CPPFLAGS) - -%.pdf: %.dot - dot -Tpdf $< -o $@ + $(CC) -fPIC -c $< -o $@ $(CFLAGS) -Wno-unused-variable -include $(OBJECTS:%=$OBJ_DIR/.%.d) @@ -55,18 +56,17 @@ clean: PHONY += mrclean mrclean: clean - rm -rf docs + rm -rf ../docs PHONY += tags tags: ctags -R tabbing: - uncrustify -c C.cfg --no-backup *.cc - uncrustify -c C.cfg --no-backup *.h + uncrustify -c C.cfg --no-backup *.c + uncrustify -c C.cfg --no-backup *.h */*.h -.PHONY: $(PHONY) +wc: + wc */*.c */*.h *.c *.h -# A 1-inch margin PDF generated by 'pandoc' -%.pdf: %.md - pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}' +.PHONY: $(PHONY)