|
1 | | -.PHONY = clean binary server debugserver standalone pgserver debugpgserver mongoserver debugmongoserver foreignserver mongotreetaggerserver |
| 1 | +.PHONY = clean binary server debugserver standalone pgserver debugpgserver mysqlserver debugmysqlserver mongoserver debugmongoserver foreignserver mongotreetaggerserver |
2 | 2 |
|
3 | | -# store executable names in make variables so that clean target works |
| 3 | +# Removed the 'all' target. It does not make sense since each build target requires a different set of defines. |
| 4 | +# So we need to clean before building each target in order compile in the right stuff. |
| 5 | +# |
| 6 | +# E.g. to build pg and mysql: |
| 7 | +# |
| 8 | +# 1. make clean pgserver |
| 9 | +# 2. make clean mysqlserver |
4 | 10 |
|
| 11 | +# Note: to build mysql targets on Ubuntu: |
| 12 | +# sudo apt-get install libmysqlclient-dev |
| 13 | + |
| 14 | +# store executable names in make variables so that cleanall target works |
5 | 15 | executable.server=../BINARIES/ChatScript |
6 | 16 | server: DEFINES+= -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 |
7 | 17 | server: PGLOAD= -pthread |
@@ -35,13 +45,29 @@ pgserver: INCLUDEDIRS=-Ievserver -Ipostgres |
35 | 45 | pgserver: CFLAGS=-c -std=c++11 -Wall -funsigned-char -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing |
36 | 46 |
|
37 | 47 | executable.debugpgserver=../BINARIES/ChatScriptpgDebug |
38 | | -debugpgserver: DEFINES+= -DLOCKUSERFILE=1 -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDMONGO=1 |
| 48 | +debugpgserver: DEFINES+= -DLOCKUSERFILE=1 -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 |
39 | 49 | debugpgserver: PGLOAD= -lpq -pthread |
40 | | -debugpgserver: INCLUDEDIRS=-Ievserver |
| 50 | +debugpgserver: INCLUDEDIRS=-Ievserver -Ipostgres |
41 | 51 | debugpgserver: binary |
42 | 52 | debugpgserver: EXECUTABLE=$(executable.debugpgserver) |
43 | 53 | debugpgserver: CFLAGS=-c -std=c++11 -Wall -funsigned-char -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g |
44 | 54 |
|
| 55 | +executable.mysqlserver=../BINARIES/ChatScriptMysql |
| 56 | +mysqlserver: DEFINES+= -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 |
| 57 | +mysqlserver: PGLOAD= -lmysqlclient -pthread |
| 58 | +mysqlserver: binary |
| 59 | +mysqlserver: EXECUTABLE=$(executable.mysqlserver) |
| 60 | +mysqlserver: INCLUDEDIRS=-Ievserver |
| 61 | +mysqlserver: CFLAGS=-c -std=c++11 -Wall -funsigned-char -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing |
| 62 | + |
| 63 | +executable.debugmysqlserver=../BINARIES/ChatScriptMysqlDebug |
| 64 | +debugmysqlserver: DEFINES+= -DLOCKUSERFILE=1 -DDEBUG -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 |
| 65 | +debugmysqlserver: PGLOAD= -lmysqlclient -pthread |
| 66 | +debugmysqlserver: INCLUDEDIRS=-Ievserver |
| 67 | +debugmysqlserver: binary |
| 68 | +debugmysqlserver: EXECUTABLE=$(executable.debugmysqlserver) |
| 69 | +debugmysqlserver: CFLAGS=-c -std=c++11 -Wall -funsigned-char -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -g |
| 70 | + |
45 | 71 | executable.mongoserver=../BINARIES/ChatScriptMongo |
46 | 72 | mongoserver: DEFINES+= -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMYSQL=1 |
47 | 73 | mongoserver: PGLOAD= -pthread |
@@ -103,21 +129,22 @@ debugmongoserver: LDFLAGS+= -lgcrypt -lsasl2 -lmongoc-1.0 -lbson-1.0 |
103 | 129 | mongotreetaggerserver: LDFLAGS+= -lgcrypt -lsasl2 -lmongoc-1.0 -lbson-1.0 |
104 | 130 | endif |
105 | 131 |
|
106 | | -SOURCES=constructCode.cpp duktape/duktape.c evserver.cpp csocket.cpp cs_ev.c dictionarySystem.cpp englishTagger.cpp factSystem.cpp json.cpp functionExecute.cpp english.cpp infer.cpp javascript.cpp jsmn.cpp markSystem.cpp mongodb.cpp os.cpp outputSystem.cpp patternSystem.cpp postgres.cpp privatesrc.cpp scriptCompile.cpp spellcheck.cpp secure.cpp systemVariables.cpp tagger.cpp testing.cpp textUtilities.cpp tokenSystem.cpp topicSystem.cpp userCache.cpp userSystem.cpp variableSystem.cpp mainSystem.cpp |
| 132 | +SOURCES=constructCode.cpp duktape/duktape.c evserver.cpp csocket.cpp cs_ev.c dictionarySystem.cpp englishTagger.cpp factSystem.cpp json.cpp functionExecute.cpp english.cpp infer.cpp javascript.cpp jsmn.cpp markSystem.cpp mysql.cpp mongodb.cpp os.cpp outputSystem.cpp patternSystem.cpp postgres.cpp privatesrc.cpp scriptCompile.cpp spellcheck.cpp secure.cpp systemVariables.cpp tagger.cpp testing.cpp textUtilities.cpp tokenSystem.cpp topicSystem.cpp userCache.cpp userSystem.cpp variableSystem.cpp mainSystem.cpp |
107 | 133 | OBJECTS=$(SOURCES:.cpp=.o) |
108 | 134 |
|
109 | | -# all target does make sense since each build target requires a different set of defines |
110 | | -# so we need to clean before building each target in order compile the right stuff |
111 | | - |
112 | 135 | default: server |
113 | 136 |
|
114 | 137 | clean: |
115 | 138 | -rm -f *.o |
| 139 | + |
| 140 | +cleanall: clean |
116 | 141 | -rm -f $(executable.server) |
117 | 142 | -rm -f $(executable.debugserver) |
118 | 143 | -rm -f $(executable.standalone) |
119 | 144 | -rm -f $(executable.pgserver) |
120 | 145 | -rm -f $(executable.debugpgserver) |
| 146 | + -rm -f $(executable.mysqlserver) |
| 147 | + -rm -f $(executable.debugmysqlserver) |
121 | 148 | -rm -f $(executable.mongoserver) |
122 | 149 | -rm -f $(executable.debugmongoserver) |
123 | 150 | -rm -f $(executable.foreignserver) |
|
0 commit comments