|
3 | 3 | CXX = g++
|
4 | 4 | CXXFLAGS += -W -Wall
|
5 | 5 | CPPFLAGS += -Iinclude
|
6 |
| - |
| 6 | +LDFLAGS += -lssl -lcrypto |
7 | 7 | OBJ = src/fpwhitelist.o src/whitelist.o src/iplist.o src/yatb.o src/forward.o src/controlthread.o src/datathread.o src/tls.o src/stringlist.o
|
8 | 8 | OBJ_TOOLS = src/config.o src/lock.o src/counter.o src/tools.o
|
9 |
| -LIBS = -lssl -lcrypto |
| 9 | + |
| 10 | +TARGETS = linux linux-debug linux-static linux-debug-static \ |
| 11 | + bsd bsd-debug bsd-static bsd-debug-static \ |
| 12 | + cygwin cygwin-debug cygwin-static cygwin-debug-static \ |
| 13 | + solaris solaris-debug solaris-static solaris-debug-static |
10 | 14 |
|
11 | 15 | ifneq ("$(findstring static,"$(MAKECMDGOALS)")","")
|
12 |
| - LDFLAGS += -static |
13 |
| - SUFFIX := $(SUFFIX)-static |
| 16 | + LDFLAGS := -static $(LDFLAGS) -ldl -lz |
| 17 | + POSTFIX := $(POSTFIX)-static |
14 | 18 | endif
|
15 |
| -ifneq ("$(findstring debug, "$(MAKECMDGOALS)")","") |
16 |
| - LIBS += -ldl -lz |
| 19 | +ifneq ("$(findstring debug,"$(MAKECMDGOALS)")","") |
17 | 20 | CXXFLAGS += -g
|
18 |
| - SUFFIX := $(SUFFIX)-debug |
| 21 | + POSTFIX := $(POSTFIX)-debug |
19 | 22 | else
|
20 | 23 | CXXLAGS += -O2
|
21 | 24 | endif
|
22 |
| - |
23 |
| -ifneq ("$(findstring cygwin, "$(MAKECMDGOALS)")","") |
24 |
| - SUFFIX := $(SUFFIX).exe |
| 25 | +ifneq ("$(findstring cygwin,"$(MAKECMDGOALS)")","") |
| 26 | + POSTFIX := $(POSTFIX).exe |
25 | 27 | else
|
26 |
| - LIBS += -lpthread |
| 28 | + LDFLAGS += -lpthread |
27 | 29 | endif
|
28 |
| - |
29 | 30 | OPENSSL_BIN ?= openssl
|
30 | 31 |
|
| 32 | +.PHONY: all yatb clean |
| 33 | + |
31 | 34 | .cc.o :
|
32 |
| - g++ -c $(CPPFLAGS) $< -o $@ |
| 35 | + $(CXX) -c $(CPPFLAGS) $< -o $@ |
33 | 36 |
|
34 | 37 | all:
|
35 | 38 | @echo "To compile yatb type"
|
|
42 | 45 | include/tls_dh.h :
|
43 | 46 | $(OPENSSL_BIN) dhparam -noout -C 2048 >>include/tls_dh.h
|
44 | 47 |
|
45 |
| -default: include/tls_dh.h $(OBJ) $(OBJ_TOOLS) src/blowcrypt.o src/bnccheck.o src/getfp.o |
46 |
| - $(CXX) $(LDFLAGS) $(OBJ) $(OBJ_TOOLS) $(LIBS) -o bin/yatb$(SUFFIX) |
47 |
| - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) src/blowcrypt.o $(OBJ_TOOLS) -o bin/blowcrypt$(SUFFIX) $(LIBS) |
48 |
| - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) src/bnccheck.o $(OBJ_TOOLS) -o bin/bnccheck$(SUFFIX) $(LIBS) |
49 |
| - $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) src/getfp.o $(OBJ_TOOLS) -o bin/getfp$(SUFFIX) $(LIBS) |
| 48 | +yatb: include/tls_dh.h $(OBJ) $(OBJ_TOOLS) src/blowcrypt.o src/bnccheck.o src/getfp.o |
| 49 | + $(CXX) $(OBJ) $(OBJ_TOOLS) -o bin/yatb$(POSTFIX) $(LDFLAGS) |
| 50 | + $(CXX) $(CXXFLAGS) $(CPPFLAGS) src/blowcrypt.o $(OBJ_TOOLS) -o bin/blowcrypt$(POSTFIX) $(LDFLAGS) |
| 51 | + $(CXX) $(CXXFLAGS) $(CPPFLAGS) src/bnccheck.o $(OBJ_TOOLS) -o bin/bnccheck$(POSTFIX) $(LDFLAGS) |
| 52 | + $(CXX) $(CXXFLAGS) $(CPPFLAGS) src/getfp.o $(OBJ_TOOLS) -o bin/getfp$(POSTFIX) $(LDFLAGS) |
50 | 53 | ifneq ($(findstring debug, "$@"),"")
|
51 |
| - strip bin/yatb$(SUFFIX) bin/blowcrypt$(SUFFIX) bin/bnccheck$(SUFFIX) bin/getfp$(SUFFIX) |
| 54 | + strip bin/yatb$(POSTFIX) bin/blowcrypt$(POSTFIX) bin/bnccheck$(POSTFIX) bin/getfp$(POSTFIX) |
52 | 55 | endif
|
53 | 56 |
|
54 |
| -linux: default |
55 |
| -linux-debug: default |
56 |
| -linux-static: default |
57 |
| -linux-debug-static: default |
58 |
| - |
59 |
| -bsd: default |
60 |
| -bsd-debug: default |
61 |
| -bsd-static: default |
62 |
| -bsd-debug-static: default |
63 |
| - |
64 |
| -cygwin: default |
65 |
| -cygwin-debug: default |
66 |
| -cygwin-static: default |
67 |
| -cygwin-debug-static: default |
68 |
| - |
69 |
| -solaris: default |
70 |
| -solaris-debug: default |
71 |
| -solaris-static: default |
72 |
| -solaris-debug-static: default |
| 57 | +.PHONY: $(TARGETS) |
| 58 | +$(TARGETS): yatb |
73 | 59 |
|
74 | 60 | clean:
|
75 | 61 | @(rm -f bin/yatb bin/blowcrypt bin/yatb-static bin/blowcrypt-static bin/yatb-debug bin/blowcrypt-debug bin/yatb-static-debug bin/blowcrypt-static-debug bin/bnccheck bin/bnccheck-static bin/bnccheck-debug bin/bnccheck-static-debug bin/*.exe src/*.o bin/getfp* include/tls_dh.h)
|
|
0 commit comments