-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
44 lines (35 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
INSTALLPATH = /opt/nada
CC = gcc
LIBS = -lm -lmysqlclient
LIBSSQLITE = -lm -lsqlite3
CFLAGS = -g -L/usr/lib64/mysql -L/usr/lib/mysql
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wmissing-declarations -Wshadow
CFLAGS += -Wpointer-arith -Wcast-qual
CFLAGS += -Wsign-compare
MACROS = -D"INSTALLPATH=\"$(INSTALLPATH)\""
SQLITEMACROS = -D"INSTALLPATH=\"$(INSTALLPATH)\"" -D"SQLITE"
none:
@echo "Please supply a command line argument. Targets are:"
@echo " - make mysql"
@echo " Compiles nada for mysql database"
@echo " - mysql sqlite"
@echo " Compiles nada for sqlite database"
mysql: baseline
sqlite: baselinesqlite
baseline:
$(CC) $(CFLAGS) $(LIBS) $(MACROS) -o nada dblayer.c baseline.c iniparser/iniparser.c iniparser/dictionary.c
$(CC) $(CFLAGS) $(LIBS) $(MACROS) -o purge-db-data purge-db-data.c dblayer.c iniparser/iniparser.c iniparser/dictionary.c
baselinesqlite:
$(CC) $(CFLAGS) $(LIBSSQLITE) $(SQLITEMACROS) -o nada dblayer-sqlite.c baseline.c iniparser/iniparser.c iniparser/dictionary.c
$(CC) $(CFLAGS) $(LIBSSQLITE) $(SQLITEMACROS) -o purge-db-data purge-db-data.c dblayer-sqlite.c iniparser/iniparser.c iniparser/dictionary.c
clean:
rm -rf nada
rm -rf purge-db-data
install:
mkdir -p $(INSTALLPATH)
cp -Rfp nada $(INSTALLPATH)
cp -Rfp baseline.ini $(INSTALLPATH)
cp -Rfp purge-db-data $(INSTALLPATH)
uninstall:
rm -rf $(INSTALLPATH)