mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
add makefile
This commit is contained in:
parent
e00eb14468
commit
dd03d8ea77
33
Makefile
Normal file
33
Makefile
Normal 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
|
Loading…
x
Reference in New Issue
Block a user