add makefile

This commit is contained in:
gwdwyy 2013-07-11 16:47:28 +08:00
parent e00eb14468
commit dd03d8ea77
2 changed files with 33 additions and 1 deletions

33
Makefile Normal file
View File

@ -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

View File

@ -2,7 +2,6 @@
#include <stdint.h>
#include <fstream>
using namespace std;
using namespace CPPCOMMON;
int main()
{