patch-src_Makefile 3.2 KB

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