update cppcommon -> limonp

This commit is contained in:
wyy 2013-10-26 09:19:02 -07:00
parent b30605e410
commit 2e22f6ed9d
5 changed files with 13 additions and 19 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
tags tags
*.demo
*swp *swp
*.out *.out
*.o *.o

View File

@ -18,32 +18,23 @@ endif
DOLINK := $(LD) $(LDFLAGS) DOLINK := $(LD) $(LDFLAGS)
SOURCES := $(wildcard *.cpp) SOURCES := $(wildcard *.cpp)
OBJS := $(patsubst %.cpp,%.o,$(SOURCES)) OBJS := $(patsubst %.cpp,%.o,$(SOURCES))
DEMOS := $(patsubst %.cpp,%.demo,$(SOURCES))
CPPJIEBADIR = ../cppjieba CPPJIEBADIR := ../cppjieba
LIBCPPJIEBA = $(CPPJIEBADIR)/libcppjieba.a LIBCPPJIEBA := $(CPPJIEBADIR)/libcppjieba.a
# remove the objs after compilation
.PHONY: clean $(LIBCPPJIEBA) .PHONY: clean $(LIBCPPJIEBA)
# Main Targets all: $(DEMOS)
all: keywordext_demo segment_demo
# This is a suffix rule %.demo: %.cpp $(LIBCPPJIEBA)
#.c.o: $(CXX) -o $@ $(CXXFLAGS) $^ $(INCS)
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $<
keywordext_demo: keywordext_demo.o $(LIBCPPJIEBA)
$(DOLINK) -o $@ $^
segment_demo: segment_demo.o $(LIBCPPJIEBA)
$(DOLINK) -o $@ $^
$(LIBCPPJIEBA): $(LIBCPPJIEBA):
cd $(CPPJIEBADIR) && $(MAKE) cd $(CPPJIEBADIR) && $(MAKE)
clean: clean:
rm -f *.o *.ut *.d *.d.* keywordext_demo segment_demo rm -f *.o *.ut *.d *.d.* $(DEMOS)
cd $(CPPJIEBADIR) && make clean cd $(CPPJIEBADIR) && make clean
sinclude $(SOURCES:.cpp=.d) sinclude $(SOURCES:.cpp=.d)

View File

@ -1,3 +1,3 @@
./segment_demo testlines.utf8 --dictpath ../dicts/jieba.dict.utf8 ./segment.demo testlines.utf8 --dictpath ../dicts/jieba.dict.utf8
./segment_demo testlines.utf8 --modelpath ../dicts/hmm_model.utf8 --algorithm cutHMM ./segment.demo testlines.utf8 --modelpath ../dicts/hmm_model.utf8 --algorithm cutHMM
./segment_demo testlines.utf8 --algorithm cutMix ./segment.demo testlines.utf8 --algorithm cutMix

View File

@ -1,5 +1,6 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <ArgvContext.hpp>
#include "../cppjieba/headers.h" #include "../cppjieba/headers.h"
using namespace CppJieba; using namespace CppJieba;

View File

@ -1,5 +1,6 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <ArgvContext.hpp>
#include "../cppjieba/headers.h" #include "../cppjieba/headers.h"
using namespace CppJieba; using namespace CppJieba;