📄 makefile
字号:
## Makefile for IPTraf 2.6### Architecture determination string borrowed from the kernel makefile.#ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/)PLATFORM = -DPLATFORM=\"$(shell uname -s)/$(ARCH)\"VERNUMBER := $(shell cat version)VERSION = -DVERSION=\"$(VERNUMBER)\"## Binary distribution will be placed here.# Production use only#BINDIR = ../../iptraf-$(VERNUMBER).bin.$(ARCH)CC = gccLIBS = -L../support -ltextbox -lpanel -lncurses # in this order!# comment this one out to omit debug code when done.DEBUG = -g #-DDEBUG# comment this one out to prevent generation of profile codePROF = #-pg# options to be passed to the compiler. I don't believe they need to be# modified (except for -m486 on non-Intel x86 platforms).CFLAGS = -Wall #-O2 #-m486DIRS = -DWORKDIR=\"$(WORKDIR)\" \ -DLOGDIR=\"$(LOGDIR)\" -DEXECDIR=\"$(TARGET)\"LDOPTS = #-static# you may want to change this to point to your ncurses include directory# if the ncurses include files are not in the default location.INCLUDEDIR = -I/usr/include/ncurses -I../support# You can uncomment this one to disable the backspace key in input fields.# This means you must use the Del key or Ctrl+H combination to erase the# character left of the cursor. You may need to use this directive if you# have an earlier version of ncurses. (Please note that earlier ncurses# versions have quirks that may result in undesirable screen behavior as# well.)BSSETTING =# -DDISABLEBS# Define this one to allow non-root users to use the program when setuid# root. Undefine to restrict use to root only. It is recommended that# you restrict execution to root only. This option does not install the# executable program with the setuid bit on, or with world-execute# permissions. If you want it, you'll have to do it yourself with chmod.## I have no plans to modify this program to be used by other users.EXECPERM =# -DALLOWUSERS################################################################################## IPTRAF DIRECTORY DEFINITIONS. YOU MAY CHANGE THESE############### TO SUIT YOUR PREFERENCES.#################################################################### installation target directory. The iptraf and rvnamed programs get# stored here. iptraf also exec's rvnamed from this directory.TARGET = /usr/local/bin# The IPTraf working directory; if you change this. Starting with this# version, this definition overrides dirs.h.WORKDIR = /var/local/iptraf# The IPTraf log file directory. IPTraf log files are placed here.# This definition overrides dirs.hLOGDIR = /var/log/iptraf## IPTraf lock file directory. This is /var/run/iptraf/ and will not# be passed to the compiler. If you want to change this, you must edit# dirs.h.## ******************** !!!!!! WARNING !!!!!! ********************# DO NOT MAKE THIS POINT TO AN EXISTING/SYSTEM DIRECTORY!!!! THE# LOCK OVERRIDE (iptraf -f) WILL ERASE FILES HERE!#*****************************************************************LOCKDIR = /var/run/iptraf#################################################################################### IPTRAF COMPILATION AND LINK RULES###################################################################### Object file namesOBJS = iptraf.o itrafmon.o packet.o tcptable.o othptab.o ifstats.o deskman.o \ipcsum.o hostmon.o utfilter.o fltedit.o tr.o \fltselect.o othipflt.o fltmgr.o ipfrag.o serv.o servname.o instances.o \timer.o revname.o pktsize.o landesc.o isdntab.o options.o promisc.o ifaces.o \error.o log.o mode.o getpath.o bar.oBINS = iptraf rvnamed rawtime cfconvall: $(BINS) @echo @size $(BINS)iptraf: $(OBJS) textlib $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) $(LIBS)textlib: make -C ../support%.o: %.c *.h version $(CC) $(CFLAGS) $(DIRS) $(INCLUDEDIR) $(VERSION) $(PLATFORM) $(PROF) $(DEBUG) $(EXECPERM) $(BSSETTING) -c -o $*.o $<rvnamed: rvnamed.o getpath.o $(CC) $(LDOPTS) $(PROF) -o rvnamed rvnamed.o getpath.orvnamed.o: rvnamed.c rvnamed.h $(CC) $(CFLAGS) $(PROF) $(DEBUG) -c -o rvnamed.o rvnamed.crawtime: rawtime.c $(CC) $(CFLAGS) $(LDOPTS) $(PROF) $(DEBUG) -o rawtime rawtime.ccfconv: cfconv.c dirs.h $(CC) $(CFLAGS) $(DEBUG) -o cfconv cfconv.c# rule to clear out all object files and the executables (pow!)clean: rm -f *.o *~ core $(BINS) make -C ../support clean# I just included this rule to clear out the .o files, leaving the# executables, stripped and ready for packing.cleano: rm -f *.o *~ strip iptraf strip rvnamed# installation ruleinstall: @./install.sh $(TARGET) $(WORKDIR) $(LOGDIR) $(LOCKDIR)# Upgrade rule#upgrade: cfconv @./cfconv## I use this special rule to force linking of the panels and ncurses# libraries into the executable, since there seems to be a lot of# libncurses.so.3 installations around, and some don't have libncurses.so# at all. Till then, I'll force them in. Do not use this rule under# normal circumstances.## This rule also creates a separate directory containing the documentation# and the compiled programs for release as a ready-to-run distribution.dist-bin: all $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) -L../support -ltextbox /usr/lib/libpanel.a /usr/lib/libncurses.a rm -rf $(BINDIR) mkdir $(BINDIR) /bin/cp -p ../CHANGES ../LICENSE ../FAQ ../INSTALL ../README* \ ../RELEASE-NOTES ../Setup $(BINDIR) /bin/cp -pR ../Documentation $(BINDIR) mkdir $(BINDIR)/src /bin/cp -p $(BINS) Makefile install.sh version $(BINDIR)/src strip $(BINDIR)/src/iptraf $(BINDIR)/src/rvnamed $(BINDIR)/src/rawtime $(BINDIR)/src/cfconv## Just in case anyone needs to link a static binary#static: $(OBJS) $(CC) -static $(PROC) -o iptraf $(OBJS) ../support/libtextbox.a -lpanel -lncurses $(CC) -static -o rvnamed rvnamed.o getpath.o $(CC) -static -o rawtime rawtime.c## Production rules. These rules are used to automate production of# the source and ready-to-run tarballs. These won't really be needed by# the general public.#tarball: clean (cd ../..;tar zcvf iptraf-$(VERNUMBER).tar.gz iptraf-$(VERNUMBER))binball: dist-bin (cd ../..;tar zcvf iptraf-$(VERNUMBER).bin.$(ARCH).tar.gz iptraf-$(VERNUMBER).bin.$(ARCH))alldist: tarball binball
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -