7 include $(TOP)config.mk
9 ##################################################################
10 # Subdirectory handling
11 ##################################################################
14 @set -e; for d in $(SUBDIRS); do \
15 echo "Making $@ in $$d"; \
16 $(MAKE) --no-print-directory TOP=../$(TOP) -C $$d $@; \
20 ##################################################################
21 # Building an RPC daemon
22 ##################################################################
26 $(PROGRAM): $(OBJS) $(LIBDEPS)
27 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
31 $(INSTALLBIN) $(PROGRAM) $(SBINDIR)/$(PREFIX)$k$(PROGRAM)
34 ##################################################################
36 ##################################################################
40 $(TOOL): $(OBJS) $(LIBDEPS)
41 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
44 ##################################################################
46 ##################################################################
55 ##################################################################
56 # Generic target rules
57 ##################################################################
60 @echo "Building $(TARGET) done."
68 ##################################################################
70 ##################################################################
72 rm -f *.o *~ \#* a.out core
75 rm -f LOG X Y Z x y z .depend
77 ##################################################################
78 # Manpage installation
79 # Isn't GNU make a wonderful thing?
80 ##################################################################
81 ifneq ($(MAN1)$(MAN5)$(MAN8)$(MAN9),)
82 MANINIT = ext=$(MAN$sEXT); dir=$(MAN$sDIR); pgs="$(MAN$s)";
83 MANLOOP = $(MANINIT) for man in $$pgs; do eval $$cmd; done
84 MDCMD = $(MKDIR) \$$dir
85 MICMD = $(RM) \$$dir/\$$man.\$$ext; \
86 echo $(INSTALLMAN) \$$man.man \$$dir/\$$man.\$$ext; \
87 $(INSTALLMAN) \$$man.man \$$dir/\$$man.\$$ext
88 LNCMD = $(RM) \$$dir/$(PREFIX)\$$man.\$$ext; \
89 echo $(LN_S) \$$man.\$$ext \$$dir/$(PREFIX)\$$man.\$$ext; \
90 $(LN_S) \$$man.\$$ext \$$dir/$(PREFIX)\$$man.\$$ext
91 PSCMD = echo \"$(MAN2PS) \$$man.man > $(TOP)postscript/\$$man.ps\"; \
92 $(MAN2PS) \$$man.man > $(TOP)postscript/\$$man.ps
95 @$(foreach s, 1 5 8 9, cmd="$(MDCMD)" $(MANLOOP);)
96 @$(foreach s, 1 5 8 9, cmd="$(MICMD)" $(MANLOOP);)
98 @$(foreach s, 1 5 8 9, cmd="$(LNCMD)" $(MANLOOP);)
102 @$(foreach s, 1 5 8 9, cmd="$(PSCMD)" $(MANLOOP);)
104 postscript installman::
108 ##################################################################
110 ##################################################################
116 ##################################################################
117 # Handling of dependencies
118 ##################################################################
121 $(CC) $(CFLAGS) -M $(OBJS:.o=.c) > .depend
124 ifeq (.depend,$(wildcard .depend))