blob: e13309c02c6bc7cbb30a0141037b47b31c8f67ee (
plain)
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
|
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,30 @@
-CFLAGS += -O2 -s -fstack-protector-all
+CFLAGS += -Wall -D_GNU_SOURCE
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
SRC = src/gslist.c src/enctype1_decoder.c src/enctype2_decoder.c src/enctype_shared.c src/mydownlib.c
#LIBS = -lpthread /usr/lib/libGeoIP.a /usr/lib/i386-linux-gnu/libz.a
#SQLIBS = /usr/lib/i386-linux-gnu/libmysqlclient.a /usr/lib/i386-linux-gnu/libm.a -ldl
LIBS = -lpthread -lGeoIP -lz
-SQLIBS = -lmysqlclient
O = $(SRC:.c=.o)
-all: gslist gslistsql
+ifneq ($(GSWEB),0)
+CFLAGS += -DGSWEB
+endif
-gslist:
- $(CC) $(SRC) $(CFLAGS) -o gslist $(LIBS) -DGSWEB
- $(CC) $(SRC) $(CFLAGS) -o gslistsql $(SQLIBS) $(LIBS) -DGSWEB -DSQL
+ifneq ($(SQL),0)
+CFLAGS += -DSQL
+LIBS += -lmysqlclient
+endif
+
+gslist: $(O)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o gslist $(O) $(LIBS)
clean:
- rm -f gslist gslistsql src/gslist.o src/enctype1_decoder.o src/enctype2_decoder.o src/enctype_shared.o src/enctypex_decoder.o src/mydownlib.o
+ rm -f gslist $(O)
install:
install -m 755 -d $(BINDIR)
install -m 755 gslist $(BINDIR)/gslist
- install -m 755 gslistsql $(BINDIR)/gslistsql
.PHONY:
clean install
|