diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d547776 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +CC = g++ +CCOPT = -Wall -c +LINK = g++ +LINKOPT = +PACKA = ar +PARCAOPT = rc +DOLINK = $(LINK) $(LINKOPT) -o $@ $^ +SOURCES := $(wildcard *.cpp) +OBJS := $(patsubst %.cpp,%.o,$(SOURCES)) + +SRCDIR = ./src +SRCLIB = $(SRCDIR)/cppjiebalib.a + +# remove the objs after compilation +.INTERMEDIATE: $(OBJS) +.PHONY: clean $(SRCLIB) + +# Main Targets +all: demo + +# This is a suffix rule +#.c.o: +%.o: %.cpp + $(CC) $(CCOPT) $< + +demo: $(OBJS) $(SRCLIB) + $(DOLINK) + +$(SRCLIB): $(SRCLIB_DEPS) + cd $(SRCDIR) && $(MAKE) + +clean: + rm -f *.o *.ut demo diff --git a/demo.cpp b/demo.cpp index bfefabd..c96fb6d 100644 --- a/demo.cpp +++ b/demo.cpp @@ -2,7 +2,6 @@ #include #include using namespace std; -using namespace CPPCOMMON; int main() {