-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
155 lines (126 loc) · 3.66 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# The GPL applies to this program.
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the
# OpenSSL library under certain conditions as described in each
# individual source file, and distribute linked combinations
# including the two.
# You must obey the GNU General Public License in all respects
# for all of the code used other than OpenSSL. If you modify
# file(s) with this exception, you may extend this exception to your
# version of the file(s), but you are not obligated to do so. If you
# do not wish to do so, delete this exception statement from your
# version. If you delete this exception statement from all source
# files in the program, then also delete it here.
# $Revision$
-include makefile.inc
# *** configure script ***
# support for tcp fast open?
#TFO=yes
# disable SSL? (no = disable so the default is use openssl)
# SSL=no
# enable NCURSES interface?
#NC=yes
# do fft in ncurses interface? (requires libfftw3)
#FW=yes
############# do not change anything below here #############
include version
TARGET=httping
LOCALEDIR=/usr/share/locale
DEBUG=yes
WFLAGS=-Wall -W -Wextra -pedantic
OFLAGS=
CFLAGS+=$(WFLAGS) $(OFLAGS) -DVERSION=\"$(VERSION)\" -DLOCALEDIR=\"$(LOCALEDIR)\"
LDFLAGS+=-lm
PACKAGE=$(TARGET)-$(VERSION)
PREFIX?=/usr
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
DOCDIR=$(PREFIX)/share/doc/$(TARGET)
INSTALL=install
INSTALLDIR=$(INSTALL) -m 0755 -d
INSTALLBIN=$(INSTALL) -m 0755
INSTALLMAN=$(INSTALL) -m 0644
INSTALLDOC=$(INSTALL) -m 0644
STRIP=/usr/bin/strip
RMDIR=/bin/rm -rf
MKDIR=/bin/mkdir
ARCHIVE=/bin/tar cf -
COMPRESS=/bin/gzip -9
TRANSLATIONS=nl.mo
OBJS=gen.o http.o io.o error.o utils.o main.o tcp.o res.o socks5.o kalman.o cookies.o help.o colors.o
MAN_EN=httping.1
MAN_NL=httping-nl.1
DOCS=license.txt license.OpenSSL readme.txt
ifeq ($(SSL),no)
CFLAGS+=-DNO_SSL
else
OBJS+=mssl.o
LDFLAGS+=-lssl -lcrypto
endif
ifeq ($(TFO),yes)
CFLAGS+=-DTCP_TFO
endif
ifeq ($(NC),yes)
CFLAGS+=-DNC
OBJS+=nc.o
LDFLAGS+=-lncursesw
endif
ifeq ($(FW),yes)
CFLAGS+=-DFW
OBJS+=fft.o
LDFLAGS+=-lfftw3
endif
ifeq ($(DEBUG),yes)
CFLAGS+=-D_DEBUG -ggdb
LDFLAGS+=-g
endif
ifeq ($(ARM),yes)
CC=arm-linux-gcc
endif
all: $(TARGET) $(TRANSLATIONS)
$(TARGET): $(OBJS)
$(CC) $(WFLAGS) $(OBJS) $(LDFLAGS) -o $(TARGET)
#
# Oh, blatant plug: http://www.vanheusden.com/wishlist.php
install: $(TARGET) $(TRANSLATIONS)
$(INSTALLDIR) $(DESTDIR)/$(BINDIR)
$(INSTALLBIN) $(TARGET) $(DESTDIR)/$(BINDIR)
$(INSTALLDIR) $(DESTDIR)/$(MANDIR)/man1
$(INSTALLMAN) $(MAN_EN) $(DESTDIR)/$(MANDIR)/man1
$(INSTALLDIR) $(DESTDIR)/$(MANDIR)/nl/man1
$(INSTALLMAN) $(MAN_NL) $(DESTDIR)/$(MANDIR)/nl/man1
$(INSTALLDIR) $(DESTDIR)/$(DOCDIR)
$(INSTALLDOC) $(DOCS) $(DESTDIR)/$(DOCDIR)
ifneq ($(DEBUG),yes)
$(STRIP) $(DESTDIR)/$(BINDIR)/$(TARGET)
endif
mkdir -p $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES
cp nl.mo $(DESTDIR)/$(PREFIX)/share/locale/nl/LC_MESSAGES/httping.mo
makefile.inc:
./configure
nl.mo: nl.po
msgfmt -o nl.mo nl.po
clean:
$(RMDIR) $(OBJS) $(TARGET) *~ core cov-int *.mo
distclean: clean
rm -f makefile.inc
package:
# source package
$(RMDIR) $(PACKAGE)*
$(MKDIR) $(PACKAGE)
$(INSTALLDOC) *.c *.h configure Makefile *.po version $(MAN_EN) $(MAN_NL) $(DOCS) $(PACKAGE)
$(INSTALLBIN) configure $(PACKAGE)
$(ARCHIVE) $(PACKAGE) | $(COMPRESS) > $(PACKAGE).tgz
$(RMDIR) $(PACKAGE)
check: makefile.inc
cppcheck -v --force -j 3 --enable=all --std=c++11 --inconclusive -I. . 2> err.txt
#
make clean
scan-build make
coverity: makefile.inc
make clean
rm -rf cov-int
CC=gcc cov-build --dir cov-int make all
tar vczf ~/site/coverity/httping.tgz README cov-int/
putsite -q
/home/folkert/.coverity-hp.sh