patch-src_Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. $Id$
  2. --- iptraf-3.0.0.orig/src/Makefile 2005-09-13 11:11:17.000000000 +0200
  3. +++ iptraf-3.0.0/src/Makefile 2011-01-21 13:46:03.628658655 +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. @@ -106,33 +109,31 @@ error.o log.o mode.o getpath.o bar.o par
  29. BINS = iptraf rvnamed rawtime
  30. all: $(BINS)
  31. - @echo
  32. - @size $(BINS)
  33. iptraf: $(OBJS) textlib
  34. - $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) $(LIBS)
  35. + $(CC) $(LDFLAGS) -o iptraf $(OBJS) $(LIBS)
  36. textlib:
  37. - make -C ../support
  38. + $(MAKE) -C ../support
  39. %.o: %.c *.h version
  40. - $(CC) $(CFLAGS) $(DIRS) $(INCLUDEDIR) $(VERSION) $(PLATFORM) $(PROF) $(DEBUG) $(EXECPERM) $(BSSETTING) -c -o $*.o $<
  41. + $(CC) $(CPPFLAGS) $(CFLAGS) $(DIRS) $(VERSION) $(PLATFORM) $(EXECPERM) $(BSSETTING) -c -o $*.o $<
  42. rvnamed: rvnamed.o getpath.o
  43. - $(CC) $(LDOPTS) $(PROF) -o rvnamed rvnamed.o getpath.o
  44. + $(CC) $(LDFLAGS) -o $@ $^
  45. rvnamed.o: rvnamed.c rvnamed.h
  46. - $(CC) $(CFLAGS) $(PROF) $(DEBUG) -c -o rvnamed.o rvnamed.c
  47. + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ rvnamed.c
  48. rawtime: rawtime.c
  49. - $(CC) $(CFLAGS) $(LDOPTS) $(PROF) $(DEBUG) -o rawtime rawtime.c
  50. + $(CC) $(CFLAGS) $(LDFLAGS) -o rawtime rawtime.c
  51. # rule to clear out all object files and the executables (pow!)
  52. clean:
  53. rm -f *.o *~ core $(BINS)
  54. - make -C ../support clean
  55. + $(MAKE) -C ../support clean
  56. # I just included this rule to clear out the .o files, leaving the
  57. # executables, stripped and ready for packing.
  58. @@ -162,7 +163,7 @@ install:
  59. # and the compiled programs for release as a ready-to-run distribution.
  60. dist-bin: all
  61. - $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) -L../support -ltextbox /usr/lib/libpanel.a /usr/lib/libncurses.a
  62. + $(CC) $(LDFLAGS) -o iptraf $(OBJS) -L../support -ltextbox -lpanel -lncurses
  63. rm -rf $(BINDIR)
  64. mkdir $(BINDIR)
  65. /bin/cp -p ../CHANGES ../LICENSE ../FAQ ../INSTALL ../README* \