Skip to content

Commit 545b302

Browse files
committed
修改makefile,文件移动位置
1 parent 399b69e commit 545b302

12 files changed

+55
-30
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*~
22
*.o
3+
*.a
34
GRTAGS
45
GTAGS
56
GPATH
File renamed without changes.

source/data.hpp includes/data.hpp

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

makefile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version = release
2+
3+
DEBUG := -DREGEX_DEBUG -g -O0
4+
INCLUDE := -I includes/
5+
OBJECTS = source/parser.o source/data.o source/regexAlgorithm.o source/automaton.o source/utildata.o source/match.o source/regex.o
6+
7+
ifeq ($(version), debug)
8+
FLAG = --std=c++11 $(DEBUG) $(INCLUDE) -c
9+
else
10+
FLAG = --std=c++11 -DNDEBUG $(INCLUDE) -c
11+
endif
12+
13+
# .PHONY: release
14+
release: $(OBJECTS)
15+
ar r libregex.a $(OBJECTS)
16+
17+
source/data.o: source/data.cpp includes/data.hpp
18+
g++ $(FLAG) -o $@ $<
19+
20+
source/parser.o: source/parser.cpp includes/parser.hpp
21+
g++ $(FLAG) -o $@ $<
22+
source/regexAlgorithm.o: source/regexAlgorithm.cpp includes/regexAlgorithm.hpp
23+
g++ $(FLAG) -o $@ $<
24+
25+
source/automaton.o: source/automaton.cpp includes/automaton.hpp
26+
g++ $(FLAG) -o $@ $<
27+
source/utildata.o: source/utildata.cpp includes/utildata.hpp
28+
g++ $(FLAG) -o $@ $<
29+
30+
source/match.o: source/match.cpp includes/match.hpp
31+
g++ $(FLAG) -o $@ $<
32+
source/regex.o: source/regex.cpp includes/regex.hpp
33+
g++ $(FLAG) -o $@ $<
34+
source/test/test.o : source/test/test.cpp
35+
g++ $(FLAG) -o $@ $<
36+
37+
38+
source/test/test: $(OBJECTS) source/test/test.o
39+
g++ --std=c++11 -o $@ $^
40+
./source/test/test
41+
42+
43+
44+
test : source/test/test
45+
clear:
46+
rm source/*.o
47+
rm source/test/*.o
48+
rm source/test/test
49+
rm libregex.a

source/makefile

-27
This file was deleted.

source/test/test.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <memory>
44
#include <fstream>
55
#include <streambuf>
6-
#include "../parser.hpp"
7-
#include "../match.hpp"
8-
#include "../regex.hpp"
6+
#include "parser.hpp"
7+
#include "match.hpp"
8+
#include "regex.hpp"
99

1010
using namespace regex::regex_internal;
1111
using namespace regex;
@@ -34,7 +34,9 @@ std::shared_ptr<Regex> CreateInterpreter(std::string s)
3434

3535
int main()
3636
{
37+
#ifdef REGEX_DEBUG
3738
testAux();
39+
#endif
3840
ParseRegexStr("abc()")->Delete();
3941
ParseRegexStr("abc(a)")->Delete();
4042
ParseRegexStr("abc(b)+?")->Delete();

0 commit comments

Comments
 (0)