"Fossies" - the Fresh Open Source Software Archive

Member "mrouted-3.9.8/Makefile" (1 Jan 2017, 4304 Bytes) of package /linux/misc/mrouted-3.9.8.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 3.9.7_vs_3.9.8.

    1 # Makefile for mrouted, a multicast router, and its auxiliary   -*-Makefile-*-
    2 # programs: map-mbone, mrinfo and mtrace.
    3 #
    4 
    5 # VERSION       ?= $(shell git tag -l | tail -1)
    6 VERSION      ?= 3.9.8
    7 NAME          = mrouted
    8 CONFIG        = $(NAME).conf
    9 EXECS         = mrouted map-mbone mrinfo mtrace
   10 PKG           = $(NAME)-$(VERSION)
   11 ARCHIVE       = $(PKG).tar.bz2
   12 
   13 ROOTDIR      ?= $(dir $(shell pwd))
   14 RM           ?= rm -f
   15 CC           ?= $(CROSS)gcc
   16 
   17 prefix       ?= /usr/local
   18 sysconfdir   ?= /etc
   19 datadir       = $(prefix)/share/doc/mrouted
   20 mandir        = $(prefix)/share/man/man8
   21 
   22 # This magic trick looks like a comment, but works on BSD PMake
   23 #include <config.mk>
   24 include config.mk
   25 
   26 IGMP_SRCS     = igmp.c inet.c kern.c
   27 IGMP_OBJS     = igmp.o inet.o kern.o
   28 
   29 ROUTER_OBJS   = config.o cfparse.o main.o route.o vif.o prune.o callout.o \
   30 		icmp.o ipip.o vers.o $(RSRR_OBJS) $(EXTRA_OBJS)
   31 ROUTER_SRCS   = $(ROUTER_OBJS:.o=.c)
   32 MAPPER_OBJS   = mapper.o $(EXTRA_OBJS)
   33 MRINFO_OBJS   = mrinfo.o $(EXTRA_OBJS)
   34 MTRACE_OBJS   = mtrace.o $(EXTRA_OBJS)
   35 #MSTAT_OBJS    = mstat.o $(EXTRA_OBJS)
   36 
   37 ## Common
   38 CFLAGS       += $(MCAST_INCLUDE) $(INCLUDES) $(DEFS) $(USERCOMPILE)
   39 CFLAGS       += -O2 -W -Wall -Wextra
   40 #CFLAGS       += -O -g
   41 LDLIBS        = $(EXTRA_LIBS)
   42 LDFLAGS      += -Wl,-Map,$@.map
   43 OBJS          = $(IGMP_OBJS) $(ROUTER_OBJS) $(MAPPER_OBJS) $(MRINFO_OBJS) \
   44 		$(MTRACE_OBJS) $(MSTAT_OBJS)
   45 SRCS          = $(OBJS:.o=.c)
   46 MANS          = $(addsuffix .8,$(EXECS))
   47 DISTFILES     = README AUTHORS LICENSE ChangeLog
   48 
   49 LINT          = splint
   50 LINTFLAGS     = $(MCAST_INCLUDE) $(filter-out -W -Wall -Werror, $(CFLAGS)) -posix-lib -weak -skipposixheaders
   51 
   52 all: $(EXECS) $(MSTAT)
   53 
   54 .y.c:
   55 	@printf "  YACC    $@\n"
   56 	@$(YACC) $<
   57 	-@mv y.tab.c $@ || mv $(<:.y=.tab.c) $@
   58 
   59 .c.o:
   60 	@printf "  CC      $@\n"
   61 	@$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
   62 
   63 install: $(EXECS)
   64 	@install -d $(DESTDIR)$(prefix)/sbin
   65 	@install -d $(DESTDIR)$(sysconfdir)
   66 	@install -d $(DESTDIR)$(datadir)
   67 	@install -d $(DESTDIR)$(mandir)
   68 	@for file in $(EXECS); do \
   69 		install -m 0755 $$file $(DESTDIR)$(prefix)/sbin/$$file; \
   70 	done
   71 	@install -b -m 0644 $(CONFIG) $(DESTDIR)$(sysconfdir)/$(CONFIG)
   72 	@for file in $(DISTFILES); do \
   73 		install -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \
   74 	done
   75 	@for file in $(MANS); do \
   76 		install -m 0644 $$file $(DESTDIR)$(mandir)/$$file; \
   77 	done
   78 
   79 uninstall:
   80 	-@for file in $(EXECS); do \
   81 		$(RM) $(DESTDIR)$(prefix)/sbin/$$file; \
   82 	done
   83 	-@$(RM) $(DESTDIR)$(sysconfdir)/$(CONFIG)
   84 	-@$(RM) -r $(DESTDIR)$(datadir)
   85 	-@for file in $(MANS); do \
   86 		$(RM) $(DESTDIR)$(mandir)/$$file; \
   87 	done
   88 
   89 mrouted: $(IGMP_OBJS) $(ROUTER_OBJS) $(CMULIBS)
   90 	@printf "  LINK    $@\n"
   91 	@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(ROUTER_OBJS) $(LDLIBS)
   92 
   93 vers.c: Makefile
   94 	@echo $(VERSION) | sed -e 's/.*/char todaysversion[]="&";/' > vers.c
   95 
   96 map-mbone: $(IGMP_OBJS) $(MAPPER_OBJS)
   97 	@printf "  LINK    $@\n"
   98 	@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MAPPER_OBJS) $(LDLIBS)
   99 
  100 mrinfo: $(IGMP_OBJS) $(MRINFO_OBJS)
  101 	@printf "  LINK    $@\n"
  102 	@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MRINFO_OBJS) $(LDLIBS)
  103 
  104 mtrace: $(IGMP_OBJS) $(MTRACE_OBJS)
  105 	@printf "  LINK    $@\n"
  106 	@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MTRACE_OBJS) $(LDLIBS)
  107 
  108 mstat: $(MSTAT_OBJS) $(CMULIBS)
  109 	@printf "  LINK    $@\n"
  110 	@$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(MSTAT_OBJS) $(LDLIBS)
  111 
  112 # Runs Clang scan-build on the whole tree
  113 check: clean
  114 	@scan-build $(MAKE) all
  115 
  116 clean:
  117 	-@$(RM) $(OBJS) $(EXECS)
  118 
  119 distclean:
  120 	-@$(RM) $(OBJS) core $(EXECS) vers.c cfparse.c *.o *.map .*.d *.out tags TAGS
  121 
  122 dist:
  123 	@echo "Building bzip2 tarball of $(PKG) in parent dir..."
  124 	git archive --format=tar --prefix=$(PKG)/ $(VERSION) | bzip2 >../$(ARCHIVE)
  125 	@(cd ..; md5sum $(ARCHIVE) | tee $(ARCHIVE).md5)
  126 
  127 build-deb:
  128 	gbp buildpackage --git-ignore-new --git-ignore-branch --git-no-create-orig --git-upstream-branch=master
  129 
  130 lint: 
  131 	@$(LINT) $(LINTFLAGS) $(SRCS)
  132 
  133 tags: $(IGMP_SRCS) $(ROUTER_SRCS)
  134 	@ctags $(IGMP_SRCS) $(ROUTER_SRCS)
  135 
  136 cflow:
  137 	@cflow $(MCAST_INCLUDE) $(IGMP_SRCS) $(ROUTER_SRCS) > cflow.out
  138 
  139 cflow2:
  140 	@cflow -ix $(MCAST_INCLUDE) $(IGMP_SRCS) $(ROUTER_SRCS) > cflow2.out
  141 
  142 rcflow:
  143 	@cflow -r $(MCAST_INCLUDE) $(IGMP_SRCS) $(ROUTER_SRCS) > rcflow.out
  144 
  145 rcflow2:
  146 	@cflow -r -ix $(MCAST_INCLUDE) $(IGMP_SRCS) $(ROUTER_SRCS) > rcflow2.out
  147 
  148 TAGS:
  149 	@etags $(SRCS)
  150