--- Makefile.orig 2017-01-01 19:28:19 UTC +++ Makefile @@ -16,8 +16,8 @@ CC ?= $(CROSS)gcc prefix ?= /usr/local sysconfdir ?= /etc -datadir = $(prefix)/share/doc/mrouted -mandir = $(prefix)/share/man/man8 +datadir ?= $(prefix)/share/doc/mrouted +mandir ?= $(prefix)/share/man/man8 # This magic trick looks like a comment, but works on BSD PMake #include @@ -36,15 +36,15 @@ MTRACE_OBJS = mtrace.o $(EXTRA_OBJS) ## Common CFLAGS += $(MCAST_INCLUDE) $(INCLUDES) $(DEFS) $(USERCOMPILE) -CFLAGS += -O2 -W -Wall -Wextra +#CFLAGS += -O2 -W -Wall -Wextra #CFLAGS += -O -g LDLIBS = $(EXTRA_LIBS) LDFLAGS += -Wl,-Map,$@.map OBJS = $(IGMP_OBJS) $(ROUTER_OBJS) $(MAPPER_OBJS) $(MRINFO_OBJS) \ $(MTRACE_OBJS) $(MSTAT_OBJS) SRCS = $(OBJS:.o=.c) -MANS = $(addsuffix .8,$(EXECS)) -DISTFILES = README AUTHORS LICENSE ChangeLog +MANS = $(EXECS:S/$/.8/) +DISTFILES = README AUTHORS ChangeLog LINT = splint LINTFLAGS = $(MCAST_INCLUDE) $(filter-out -W -Wall -Werror, $(CFLAGS)) -posix-lib -weak -skipposixheaders @@ -52,24 +52,22 @@ LINTFLAGS = $(MCAST_INCLUDE) $(filte all: $(EXECS) $(MSTAT) .y.c: - @printf " YACC $@\n" - @$(YACC) $< + $(YACC) $< -@mv y.tab.c $@ || mv $(<:.y=.tab.c) $@ .c.o: - @printf " CC $@\n" - @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< install: $(EXECS) @install -d $(DESTDIR)$(prefix)/sbin @install -d $(DESTDIR)$(sysconfdir) - @install -d $(DESTDIR)$(datadir) + @[ -z "${doc}" ] || install -d $(DESTDIR)$(datadir) @install -d $(DESTDIR)$(mandir) @for file in $(EXECS); do \ - install -m 0755 $$file $(DESTDIR)$(prefix)/sbin/$$file; \ + install -s -m 0755 $$file $(DESTDIR)$(prefix)/sbin/$$file; \ done @install -b -m 0644 $(CONFIG) $(DESTDIR)$(sysconfdir)/$(CONFIG) - @for file in $(DISTFILES); do \ + @[ -z "${doc}" ] || for file in $(DISTFILES); do \ install -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \ done @for file in $(MANS); do \ @@ -87,27 +85,22 @@ uninstall: done mrouted: $(IGMP_OBJS) $(ROUTER_OBJS) $(CMULIBS) - @printf " LINK $@\n" - @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(ROUTER_OBJS) $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(ROUTER_OBJS) $(LDLIBS) vers.c: Makefile @echo $(VERSION) | sed -e 's/.*/char todaysversion[]="&";/' > vers.c map-mbone: $(IGMP_OBJS) $(MAPPER_OBJS) - @printf " LINK $@\n" - @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MAPPER_OBJS) $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MAPPER_OBJS) $(LDLIBS) mrinfo: $(IGMP_OBJS) $(MRINFO_OBJS) - @printf " LINK $@\n" - @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MRINFO_OBJS) $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MRINFO_OBJS) $(LDLIBS) mtrace: $(IGMP_OBJS) $(MTRACE_OBJS) - @printf " LINK $@\n" - @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MTRACE_OBJS) $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(IGMP_OBJS) $(MTRACE_OBJS) $(LDLIBS) mstat: $(MSTAT_OBJS) $(CMULIBS) - @printf " LINK $@\n" - @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(MSTAT_OBJS) $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(MSTAT_OBJS) $(LDLIBS) # Runs Clang scan-build on the whole tree check: clean