Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Makefile for the pingtunnel utility
  2. # (c) 2004-2009 Daniel Stoedle, daniels@cs.uit.no
  3. # ptunnel.exe target added by Mike Miller, mike@mikeage.net
  4. CC = gcc
  5. CFLAGS = -Wall -g -fstrict-aliasing -Os
  6. LDOPTS = -lpthread -lpcap
  7. PT_OBJS = utils.o options.o pkt.o challenge.o pdesc.o ptunnel.o md5.o
  8. WIN32_CC = mingw32-gcc
  9. WIN32_CFLAGS = -g -Wall -DWIN32 -I"c:\Program Files\WpdPack\Include"
  10. WIN32_LDOPTS = -lwpcap -lwsock32 -L"c:\Program Files\WpdPack\Lib"
  11. WIN32_PT_OBJS = utils.obj options.obj pkt.obj challenge.obj pdesc.obj ptunnel.obj md5.obj
  12. prefix = $(DESTDIR)/usr
  13. bindir = $(prefix)/sbin
  14. mandir = $(prefix)/share/man/man8
  15. all: ptunnel
  16. dist:
  17. rm -rf PingTunnel/
  18. mkdir PingTunnel
  19. cp ptunnel.c ptunnel.h Makefile.dist PingTunnel/
  20. mv PingTunnel/Makefile.dist PingTunnel/Makefile
  21. install: ptunnel
  22. install -d $(bindir)/
  23. install -d $(mandir)/
  24. install ./ptunnel $(bindir)/ptunnel
  25. install ./ptunnel.8 $(mandir)/ptunnel.8
  26. ptunnel: $(PT_OBJS)
  27. $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(LDOPTS) `[ -e /usr/include/selinux/selinux.h ] && echo -lselinux`
  28. ptunnel.exe: $(WIN32_PT_OBJS)
  29. $(CC) -o $@ $^ $(WIN32_LDOPTS)
  30. clean:
  31. -rm -f *.o ptunnel
  32. -rm -f *.obj ptunnel.exe
  33. -rm -f .depend
  34. depend: .depend
  35. .depend:
  36. $(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > $@
  37. %.o:%.c
  38. $(CC) $(CFLAGS) $(CPPFLAGS) `[ -e /usr/include/selinux/selinux.h ] && echo -DHAVE_SELINUX` -c -o $@ $<
  39. %.obj:%.c
  40. $(WIN32_CC) $(WIN32_CFLAGS) -c -o $@ $<
  41. -include .depend