-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
executable file
·55 lines (41 loc) · 1.24 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
# Makefile for the pingtunnel utility
# (c) 2004-2009 Daniel Stoedle, [email protected]
# ptunnel.exe target added by Mike Miller, [email protected]
CC = gcc
CFLAGS = -Wall -g
LDOPTS = -lpthread -lpcap
PT_OBJS = ptunnel.o md5.o
WIN32_CC = mingw32-gcc
WIN32_CFLAGS = -g -Wall -DWIN32 -I"c:\Program Files\WpdPack\Include"
WIN32_LDOPTS = -lwpcap -lwsock32 -L"c:\Program Files\WpdPack\Lib"
WIN32_PT_OBJS = ptunnel.obj md5.obj
prefix = /usr
bindir = $(prefix)/bin
mandir = $(prefix)/share/man/man8
all: ptunnel
dist:
rm -rf PingTunnel/
mkdir PingTunnel
cp ptunnel.c ptunnel.h Makefile.dist PingTunnel/
mv PingTunnel/Makefile.dist PingTunnel/Makefile
install: ptunnel
install -d $(bindir)/
install -d $(mandir)/
install ./ptunnel $(bindir)/ptunnel
install ./ptunnel.8 $(mandir)/ptunnel.8
ptunnel: $(PT_OBJS)
$(CC) -o $@ $^ $(LDOPTS) `[ -e /usr/include/selinux/selinux.h ] && echo -lselinux`
ptunnel.exe: $(WIN32_PT_OBJS)
$(CC) -o $@ $^ $(WIN32_LDOPTS)
clean:
-rm -f *.o ptunnel
-rm -f *.obj ptunnel.exe
-rm -f .depend
depend: .depend
.depend:
$(CC) $(CFLAGS) -MM *.c > $@
%.o:%.c
$(CC) $(CFLAGS) `[ -e /usr/include/selinux/selinux.h ] && echo -DHAVE_SELINUX` -c -o $@ $<
%.obj:%.c
$(WIN32_CC) $(WIN32_CFLAGS) -c -o $@ $<
-include .depend