patch-src_Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. $Id$
  2. --- iptraf-3.0.1.orig/src/Makefile 2005-09-13 11:11:17.000000000 +0200
  3. +++ iptraf-3.0.1/src/Makefile 2013-03-04 11:42:11.000000000 +0100
  4. @@ -18,7 +18,8 @@ VERSION = -DVERSION=\"$(VERNUMBER)\"
  5. BINDIR = ../../iptraf-$(VERNUMBER).bin.$(ARCH)
  6. CC = gcc
  7. -LIBS = -L../support -ltextbox -lpanel -lncurses # in this order!
  8. +LIBS ?=
  9. +LIBS += -ltextbox -lpanel -lncurses # in this order!
  10. # comment this one out to omit debug code when done.
  11. @@ -31,15 +32,17 @@ PROF = #-pg
  12. # options to be passed to the compiler. I don't believe they need to be
  13. # modified (except for -m486 on non-Intel x86 platforms).
  14. -CFLAGS = -Wall #-O2 #-m486
  15. +CFLAGS ?= -Wall #-O2 #-m486
  16. DIRS = -DWORKDIR=\"$(WORKDIR)\" \
  17. -DLOGDIR=\"$(LOGDIR)\" -DEXECDIR=\"$(TARGET)\"
  18. -LDOPTS = #-static
  19. +LDFLAGS ?=
  20. +LDFLAGS += -L../support
  21. # you may want to change this to point to your ncurses include directory
  22. # if the ncurses include files are not in the default location.
  23. -INCLUDEDIR = -I/usr/include/ncurses -I../support
  24. +CPPFLAGS ?=
  25. +CPPFLAGS += -I../support
  26. # You can uncomment this one to disable the backspace key in input fields.
  27. # This means you must use the Del key or Ctrl+H combination to erase the
  28. @@ -98,7 +101,7 @@ LOCKDIR = /var/run/iptraf
  29. # Object file names
  30. OBJS = iptraf.o itrafmon.o packet.o tcptable.o othptab.o ifstats.o deskman.o \
  31. -ipcsum.o hostmon.o fltedit.o tr.o cidr.o \
  32. +ipcsum.o hostmon.o fltedit.o cidr.o \
  33. fltselect.o ipfilter.o fltmgr.o ipfrag.o serv.o servname.o instances.o \
  34. timer.o revname.o pktsize.o landesc.o isdntab.o options.o promisc.o ifaces.o \
  35. error.o log.o mode.o getpath.o bar.o parseproto.o
  36. @@ -106,33 +109,31 @@ error.o log.o mode.o getpath.o bar.o par
  37. BINS = iptraf rvnamed rawtime
  38. all: $(BINS)
  39. - @echo
  40. - @size $(BINS)
  41. iptraf: $(OBJS) textlib
  42. - $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) $(LIBS)
  43. + $(CC) $(LDFLAGS) -o iptraf $(OBJS) $(LIBS)
  44. textlib:
  45. - make -C ../support
  46. + $(MAKE) -C ../support
  47. %.o: %.c *.h version
  48. - $(CC) $(CFLAGS) $(DIRS) $(INCLUDEDIR) $(VERSION) $(PLATFORM) $(PROF) $(DEBUG) $(EXECPERM) $(BSSETTING) -c -o $*.o $<
  49. + $(CC) $(CPPFLAGS) $(CFLAGS) $(DIRS) $(VERSION) $(PLATFORM) $(EXECPERM) $(BSSETTING) -c -o $*.o $<
  50. rvnamed: rvnamed.o getpath.o
  51. - $(CC) $(LDOPTS) $(PROF) -o rvnamed rvnamed.o getpath.o
  52. + $(CC) $(LDFLAGS) -o $@ $^
  53. rvnamed.o: rvnamed.c rvnamed.h
  54. - $(CC) $(CFLAGS) $(PROF) $(DEBUG) -c -o rvnamed.o rvnamed.c
  55. + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ rvnamed.c
  56. rawtime: rawtime.c
  57. - $(CC) $(CFLAGS) $(LDOPTS) $(PROF) $(DEBUG) -o rawtime rawtime.c
  58. + $(CC) $(CFLAGS) $(LDFLAGS) -o rawtime rawtime.c
  59. # rule to clear out all object files and the executables (pow!)
  60. clean:
  61. rm -f *.o *~ core $(BINS)
  62. - make -C ../support clean
  63. + $(MAKE) -C ../support clean
  64. # I just included this rule to clear out the .o files, leaving the
  65. # executables, stripped and ready for packing.
  66. @@ -162,7 +163,7 @@ install:
  67. # and the compiled programs for release as a ready-to-run distribution.
  68. dist-bin: all
  69. - $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) -L../support -ltextbox /usr/lib/libpanel.a /usr/lib/libncurses.a
  70. + $(CC) $(LDFLAGS) -o iptraf $(OBJS) -L../support -ltextbox -lpanel -lncurses
  71. rm -rf $(BINDIR)
  72. mkdir $(BINDIR)
  73. /bin/cp -p ../CHANGES ../LICENSE ../FAQ ../INSTALL ../README* \