diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2017-11-04 17:43:22 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2017-11-04 17:43:22 +0100 |
commit | 168e28e950f8540b287aa095f03ce37f4e3811e1 (patch) | |
tree | e76829264efa3eb11864e75eaade1b966b6ae011 /Makefile |
initial commit
Diffstat (limited to 'Makefile')
-rwxr-xr-x | Makefile | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..0a9ed0e --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# Makefile for the pingtunnel utility +# (c) 2004-2009 Daniel Stoedle, daniels@cs.uit.no +# ptunnel.exe target added by Mike Miller, mike@mikeage.net + +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 = $(DESTDIR)/usr +bindir = $(prefix)/sbin +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) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -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) $(CPPFLAGS) -MM *.c > $@ + +%.o:%.c + $(CC) $(CFLAGS) $(CPPFLAGS) `[ -e /usr/include/selinux/selinux.h ] && echo -DHAVE_SELINUX` -c -o $@ $< + +%.obj:%.c + $(WIN32_CC) $(WIN32_CFLAGS) -c -o $@ $< + +-include .depend |