Radix cross Linux

The main Radix cross Linux repository contains the build scripts of packages, which have the most complete and common functionality for desktop machines

452 Commits   2 Branches   1 Tag
     5         kx # The default target of this Makefile is this
     5         kx all::
     5         kx 
     5         kx # Define V=1 to have a more verbose compile.
     5         kx #
     5         kx # Define NO_PANEL if you don't want to use -lpanel.
     5         kx #
     5         kx # Define NEEDS_NCURSES5 if you need linking with ncurses5.
     5         kx #
     5         kx # Define NEEDS_NCURSESW5 if you need linking with ncursesw5.
     5         kx #
     5         kx # Define NEEDS_NCURSES6 if you need linking with ncurses6.
     5         kx #
     5         kx # Define NEEDS_NCURSESW6 if you need linking with ncursesw6.
     5         kx 
     5         kx 
     5         kx VERSION-FILE: FORCE
     5         kx 	@$(SHELL_PATH) ./GEN-VERSION-FILE
     5         kx -include VERSION-FILE
     5         kx 
     5         kx IPTRAF_CFLAGS := -std=gnu99 -D_GNU_SOURCE
     5         kx ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) $(IPTRAF_CFLAGS)
     5         kx ALL_LDFLAGS = $(LDFLAGS)
     5         kx STRIP ?= strip
     5         kx 
     5         kx prefix = $(PREFIX)
     5         kx sbindir_relative = sbin
     5         kx ifndef SBINDIR
     5         kx sbindir = $(prefix)/$(sbindir_relative)
     5         kx else
     5         kx sbindir = $(SBINDIR)
     5         kx endif
     5         kx mandir = $(prefix)/share/man
     5         kx sharedir = $(prefix)/share
     5         kx localedir = $(sharedir)/locale
     5         kx lib = lib
     5         kx man8dir = $(mandir)/man8
     5         kx 
     5         kx # DESTDIR=
     5         kx pathsep = :
     5         kx 
     5         kx export prefix bindir sharedir sysconfdir gitwebdir localedir
     5         kx 
     5         kx RM = rm -f
     5         kx INSTALL = install
     5         kx RPMBUILD = rpmbuild
     5         kx TAR = tar
     5         kx 
     5         kx ### --- END CONFIGURATION SECTION ---
     5         kx 
     5         kx 
     5         kx # Those must not be GNU-specific; they are shared with perl/ which may
     5         kx # be built by a different compiler. (Note that this is an artifact now
     5         kx # but it still might be nice to keep that distinction.)
     5         kx BASIC_CFLAGS = -I. -Isrc/
     5         kx BASIC_LDFLAGS =
     5         kx 
     5         kx # Guard against environment variables
     5         kx iptraf-h :=
     5         kx iptraf-o :=
     5         kx 
     5         kx ALL_PROGRAMS := iptraf-ng
     5         kx 
     5         kx ifndef SHELL_PATH
     5         kx 	SHELL_PATH = /bin/sh
     5         kx endif
     5         kx 
     5         kx iptraf-h += src/tui/input.h
     5         kx iptraf-h += src/tui/labels.h
     5         kx iptraf-h += src/tui/listbox.h
     5         kx iptraf-h += src/tui/menurt.h
     5         kx iptraf-h += src/tui/msgboxes.h
     5         kx iptraf-h += src/tui/winops.h
     5         kx iptraf-h += src/iptraf-ng-compat.h
     5         kx iptraf-h += src/parse-options.h
     5         kx iptraf-h += src/packet.h
     5         kx iptraf-h += src/tcptable.h
     5         kx iptraf-h += src/othptab.h
     5         kx iptraf-h += src/ifstats.h
     5         kx iptraf-h += src/deskman.h
     5         kx iptraf-h += src/hostmon.h
     5         kx iptraf-h += src/fltedit.h
     5         kx iptraf-h += src/cidr.h
     5         kx iptraf-h += src/fltselect.h
     5         kx iptraf-h += src/ipfilter.h
     5         kx iptraf-h += src/fltmgr.h
     5         kx iptraf-h += src/ipfrag.h
     5         kx iptraf-h += src/serv.h
     5         kx iptraf-h += src/servname.h
     5         kx iptraf-h += src/timer.h
     5         kx iptraf-h += src/ifaces.h
     5         kx iptraf-h += src/error.h
     5         kx iptraf-h += src/revname.h
     5         kx iptraf-h += src/log.h
     5         kx iptraf-h += src/pktsize.h
     5         kx iptraf-h += src/landesc.h
     5         kx iptraf-h += src/dirs.h
     5         kx iptraf-h += src/getpath.h
     5         kx iptraf-h += src/options.h
     5         kx iptraf-h += src/promisc.h
     5         kx iptraf-h += src/parseproto.h
     5         kx iptraf-h += src/addproto.h
     5         kx iptraf-h += src/arphdr.h
     5         kx iptraf-h += src/attrs.h
     5         kx iptraf-h += src/fltdefs.h
     5         kx iptraf-h += src/logvars.h
     5         kx iptraf-h += src/list.h
     5         kx iptraf-h += src/counters.h
     5         kx iptraf-h += src/rate.h
     5         kx iptraf-h += src/built-in.h
     5         kx iptraf-h += src/sockaddr.h
     5         kx iptraf-h += src/capt.h
     5         kx iptraf-h += src/capt-recvmsg.h
     5         kx iptraf-h += src/capt-recvmmsg.h
     5         kx iptraf-h += src/capt-mmap-v2.h
     5         kx iptraf-h += src/capt-mmap-v3.h
     5         kx 
     5         kx iptraf-o += src/tui/input.o
     5         kx iptraf-o += src/tui/labels.o
     5         kx iptraf-o += src/tui/listbox.o
     5         kx iptraf-o += src/tui/menurt.o
     5         kx iptraf-o += src/tui/msgboxes.o
     5         kx iptraf-o += src/tui/winops.o
     5         kx iptraf-o += src/error.o
     5         kx iptraf-o += src/log.o
     5         kx iptraf-o += src/getpath.o
     5         kx iptraf-o += src/parseproto.o
     5         kx iptraf-o += src/fltselect.o
     5         kx iptraf-o += src/ipfilter.o
     5         kx iptraf-o += src/fltmgr.o
     5         kx iptraf-o += src/ipfrag.o
     5         kx iptraf-o += src/serv.o
     5         kx iptraf-o += src/servname.o
     5         kx iptraf-o += src/timer.o
     5         kx iptraf-o += src/revname.o
     5         kx iptraf-o += src/pktsize.o
     5         kx iptraf-o += src/landesc.o
     5         kx iptraf-o += src/options.o
     5         kx iptraf-o += src/promisc.o
     5         kx iptraf-o += src/ifaces.o
     5         kx iptraf-o += src/usage.o
     5         kx iptraf-o += src/iptraf.o
     5         kx iptraf-o += src/itrafmon.o
     5         kx iptraf-o += src/wrapper.o
     5         kx iptraf-o += src/parse-options.o
     5         kx iptraf-o += src/packet.o
     5         kx iptraf-o += src/tcptable.o
     5         kx iptraf-o += src/othptab.o
     5         kx iptraf-o += src/ifstats.o
     5         kx iptraf-o += src/detstats.o
     5         kx iptraf-o += src/deskman.o
     5         kx iptraf-o += src/hostmon.o
     5         kx iptraf-o += src/fltedit.o
     5         kx iptraf-o += src/cidr.o
     5         kx iptraf-o += src/counters.o
     5         kx iptraf-o += src/rate.o
     5         kx iptraf-o += src/capture-pkt.o
     5         kx iptraf-o += src/sockaddr.o
     5         kx iptraf-o += src/capt.o
     5         kx iptraf-o += src/capt-recvmsg.o
     5         kx iptraf-o += src/capt-recvmmsg.o
     5         kx iptraf-o += src/capt-mmap-v2.o
     5         kx iptraf-o += src/capt-mmap-v3.o
     5         kx iptraf-o += src/rvnamed.o
     5         kx 
     5         kx ifndef sysconfdir
     5         kx ifeq ($(prefix),/usr)
     5         kx sysconfdir = /etc
     5         kx else
     5         kx sysconfdir = etc
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifdef CHECK_HEADER_DEPENDENCIES
     5         kx COMPUTE_HEADER_DEPENDENCIES = no
     5         kx USE_COMPUTED_HEADER_DEPENDENCIES =
     5         kx endif
     5         kx 
     5         kx ifndef COMPUTE_HEADER_DEPENDENCIES
     5         kx COMPUTE_HEADER_DEPENDENCIES = auto
     5         kx endif
     5         kx 
     5         kx ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto)
     5         kx dep_check = $(shell $(CC) $(ALL_CFLAGS) \
     5         kx 	-c -MF /dev/null -MMD -MP -x c /dev/null -o /dev/null 2>&1; \
     5         kx 	echo $$?)
     5         kx ifeq ($(dep_check),0)
     5         kx override COMPUTE_HEADER_DEPENDENCIES = yes
     5         kx else
     5         kx override COMPUTE_HEADER_DEPENDENCIES = no
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
     5         kx USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease
     5         kx else
     5         kx ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no)
     5         kx $(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \
     5         kx (not "$(COMPUTE_HEADER_DEPENDENCIES)"))
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef NCURSES_LDFLAGS
     5         kx ifdef NEEDS_NCURSES5
     5         kx 	NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null)
     5         kx 	NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null)
     5         kx 	ifndef NO_PANEL
     5         kx 		NCURSES_LDFLAGS += -lpanel
     5         kx 	endif
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef NCURSES_LDFLAGS
     5         kx ifdef NEEDS_NCURSESW5
     5         kx 	NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null)
     5         kx 	NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null)
     5         kx 	ifndef NO_PANEL
     5         kx 		NCURSES_LDFLAGS += -lpanelw
     5         kx 	endif
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef NCURSES_LDFLAGS
     5         kx ifdef NEEDS_NCURSES6
     5         kx 	NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null)
     5         kx 	NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null)
     5         kx 	ifndef NO_PANEL
     5         kx 		NCURSES_LDFLAGS += -lpanel
     5         kx 	endif
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef NCURSES_LDFLAGS
     5         kx ifdef NEEDS_NCURSESW6
     5         kx 	NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null)
     5         kx 	NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null)
     5         kx 	ifndef NO_PANEL
     5         kx 		NCURSES_LDFLAGS += -lpanelw
     5         kx 	endif
     5         kx endif
     5         kx endif
     5         kx 
     5         kx # try find ncuses by autodetect
     5         kx ifndef NCURSES_LDFLAGS
     5         kx 	ifneq ($(shell ncursesw6-config --libs 2>/dev/null),)
     5         kx 		NCURSES_CFLAGS := $(shell ncursesw6-config --cflags 2>/dev/null)
     5         kx 		NCURSES_LDFLAGS := $(shell ncursesw6-config --libs 2>/dev/null)
     5         kx 		ifndef NO_PANEL
     5         kx 			NCURSES_LDFLAGS += -lpanelw
     5         kx 		endif
     5         kx 	else ifneq ($(shell ncurses6-config --libs 2>/dev/null),)
     5         kx 		NCURSES_CFLAGS := $(shell ncurses6-config --cflags 2>/dev/null)
     5         kx 		NCURSES_LDFLAGS := $(shell ncurses6-config --libs 2>/dev/null)
     5         kx 		ifndef NO_PANEL
     5         kx 			NCURSES_LDFLAGS += -lpanel
     5         kx 		endif
     5         kx 	else ifneq ($(shell ncursesw5-config --libs 2>/dev/null),)
     5         kx 		NCURSES_CFLAGS := $(shell ncursesw5-config --cflags 2>/dev/null)
     5         kx 		NCURSES_LDFLAGS := $(shell ncursesw5-config --libs 2>/dev/null)
     5         kx 		ifndef NO_PANEL
     5         kx 			NCURSES_LDFLAGS += -lpanelw
     5         kx 		endif
     5         kx 	else ifneq ($(shell ncurses5-config --libs 2>/dev/null),)
     5         kx 		NCURSES_CFLAGS := $(shell ncurses5-config --cflags 2>/dev/null)
     5         kx 		NCURSES_LDFLAGS := $(shell ncurses5-config --libs 2>/dev/null)
     5         kx 		ifndef NO_PANEL
     5         kx 			NCURSES_LDFLAGS += -lpanel
     5         kx 		endif
     5         kx 	endif
     5         kx endif
     5         kx 
     5         kx QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
     5         kx QUIET_SUBDIR1  =
     5         kx 
     5         kx ifneq ($(findstring $(MAKEFLAGS),w),w)
     5         kx PRINT_DIR = --no-print-directory
     5         kx else # "make -w"
     5         kx NO_SUBDIR = :
     5         kx endif
     5         kx 
     5         kx ifneq ($(findstring $(MAKEFLAGS),s),s)
     5         kx ifndef V
     5         kx 	QUIET_CC       = @echo '   ' CC $@;
     5         kx 	QUIET_LINK     = @echo '   ' LINK $@;
     5         kx 	QUIET_GEN      = @echo '   ' GEN $@;
     5         kx 	QUIET_SUBDIR0  = +@subdir=
     5         kx 	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
     5         kx 			 $(MAKE) $(PRINT_DIR) -C $$subdir
     5         kx 	export V
     5         kx 	export QUIET_GEN
     5         kx 	export QUIET_BUILT_IN
     5         kx endif
     5         kx endif
     5         kx 
     5         kx 
     5         kx DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
     5         kx sbindir_SQ = $(subst ','\'',$(sbindir))
     5         kx 
     5         kx ALL_CFLAGS += $(BASIC_CFLAGS)
     5         kx ALL_LDFLAGS += $(BASIC_LDFLAGS)
     5         kx 
     5         kx export TAR INSTALL DESTDIR SHELL_PATH
     5         kx 
     5         kx ### Build rules
     5         kx 
     5         kx SHELL = $(SHELL_PATH)
     5         kx 
     5         kx #all:: shell_compatibility_test
     5         kx #please_set_SHELL_PATH_to_a_more_modern_shell:
     5         kx #	@$$(:)
     5         kx #shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
     5         kx 
     5         kx 
     5         kx all:: $(ALL_PROGRAMS)
     5         kx 
     5         kx iptraf-ng: $(iptraf-o)
     5         kx 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ \
     5         kx 		$(iptraf-o) $(ALL_LDFLAGS) $(NCURSES_LDFLAGS)
     5         kx 
     5         kx src/deskman.o src/iptraf.o: VERSION-FILE
     5         kx src/deskman.o src/iptraf.o src/capture-pkt.o: EXTRA_CPPFLAGS = \
     5         kx 	-DIPTRAF_VERSION='"$(IPTRAF_VERSION)"' \
     5         kx 	-DIPTRAF_NAME='"iptraf-ng"'
     5         kx 
     5         kx OBJECTS := $(sort $(iptraf-o))
     5         kx 
     5         kx dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
     5         kx dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
     5         kx 
     5         kx ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
     5         kx $(dep_dirs):
     5         kx 	@mkdir -p $@
     5         kx 
     5         kx missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
     5         kx dep_file = $(dir $@).depend/$(notdir $@).d
     5         kx dep_args = -MF $(dep_file) -MMD -MP
     5         kx ifdef CHECK_HEADER_DEPENDENCIES
     5         kx $(error cannot compute header dependencies outside a normal build. \
     5         kx Please unset CHECK_HEADER_DEPENDENCIES and try again)
     5         kx endif
     5         kx endif
     5         kx 
     5         kx .SUFFIXES:
     5         kx 
     5         kx ifdef PRINT_HEADER_DEPENDENCIES
     5         kx $(OBJECTS): %.o: %.c FORCE
     5         kx 	echo $^
     5         kx 
     5         kx ifndef CHECK_HEADER_DEPENDENCIES
     5         kx $(error cannot print header dependencies during a normal build. \
     5         kx Please set CHECK_HEADER_DEPENDENCIES and try again)
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef PRINT_HEADER_DEPENDENCIES
     5         kx ifdef CHECK_HEADER_DEPENDENCIES
     5         kx $(OBJECTS): %.o: %.c $(dep_files) FORCE
     5         kx 	@set -e; echo CHECK $@; \
     5         kx 	missing_deps="$(missing_deps)"; \
     5         kx 	if test "$$missing_deps"; \
     5         kx 	then \
     5         kx 		echo missing dependencies: $$missing_deps; \
     5         kx 		false; \
     5         kx 	fi
     5         kx endif
     5         kx endif
     5         kx 
     5         kx ifndef CHECK_HEADER_DEPENDENCIES
     5         kx $(OBJECTS): %.o: %.c $(missing_dep_dirs)
     5         kx 	$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(NCURSES_CFLAGS) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
     5         kx endif
     5         kx 
     5         kx ifdef USE_COMPUTED_HEADER_DEPENDENCIES
     5         kx # Take advantage of gcc's on-the-fly dependency generation
     5         kx # See <http://gcc.gnu.org/gcc-3.0/features.html>.
     5         kx dep_files_present := $(wildcard $(dep_files))
     5         kx ifneq ($(dep_files_present),)
     5         kx include $(dep_files_present)
     5         kx endif
     5         kx else
     5         kx # Dependencies on header files, for platforms that do not support
     5         kx # the gcc -MMD option.
     5         kx #
     5         kx # Dependencies on automatically generated headers such as common-cmds.h
     5         kx # should _not_ be included here, since they are necessary even when
     5         kx # building an object for the first time.
     5         kx #
     5         kx # XXX. Please check occasionally that these include all dependencies
     5         kx # gcc detects!
     5         kx 
     5         kx $(OBJECTS): $(iptraf-h)
     5         kx endif
     5         kx 
     5         kx 
     5         kx ### Maintainer's dist rules
     5         kx 
     5         kx IPTRAF_TARNAME = iptraf-ng-$(IPTRAF_VERSION)
     5         kx dist:
     5         kx 	@mkdir -p $(IPTRAF_TARNAME)
     5         kx 	@cp --parents `git ls-files` $(IPTRAF_TARNAME)
     5         kx 	$(TAR) cf $(IPTRAF_TARNAME).tar $(IPTRAF_TARNAME)
     5         kx 	@$(RM) -rf $(IPTRAF_TARNAME)
     5         kx 	gzip -f -9 $(IPTRAF_TARNAME).tar
     5         kx 
     5         kx ### Documentation rules
     5         kx html: Documentation/book1.html
     5         kx pdf: Documentation/manual.pdf
     5         kx 
     5         kx Documentation/book1.html: Documentation/manual.sgml
     5         kx 	cd Documentation && docbook2html manual.sgml
     5         kx 
     5         kx Documentation/manual.pdf: Documentation/manual.sgml
     5         kx 	cd Documentation && docbook2pdf manual.sgml
     5         kx 
     5         kx Documentation/manual.sgml: Documentation/manual.sgml.in VERSION-FILE
     5         kx 	cat $< | sed \
     5         kx 		-e s/@@version@@/`echo $(IPTRAF_VERSION) | cut -d. -f1-3`/ \
     5         kx 		-e s/@@major@@/`echo $(IPTRAF_VERSION) | cut -d. -f1-2`/ \
     5         kx 	> $@
     5         kx 
     5         kx ## TODO: use asciidoc to generate mans
     5         kx 
     5         kx ### Installation rules
     5         kx install: all
     5         kx 	@echo $(DESTDIR_SQ)$(man8dir)
     5         kx 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sbindir_SQ)'
     5         kx 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(sbindir_SQ)'
     5         kx 	$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
     5         kx 	$(INSTALL) -m 644 src/iptraf-ng.8  $(DESTDIR)$(man8dir)
     5         kx 
     5         kx ### Cleaning rules
     5         kx 
     5         kx distclean: clean
     5         kx 
     5         kx clean:
     5         kx 	$(RM) Documentation/manual.sgml
     5         kx 	$(RM) Documentation/manual.pdf
     5         kx 	$(RM) Documentation/*.html
     5         kx 	$(RM) $(iptraf-o)
     5         kx 	$(RM) $(ALL_PROGRAMS)
     5         kx 	$(RM) -r $(dep_dirs)
     5         kx 	$(RM) $(IPTRAF_TARNAME).tar.gz
     5         kx 	$(RM) VERSION-FILE
     5         kx 
     5         kx gtags:
     5         kx 	$(QUIET_GEN) gtags
     5         kx 
     5         kx .PHONY: clean distclean all install html pdf gtags FORCE