Makefile.rules
247c2b65
 #
 # $Id$
 #
 #
 # common Makefile rules, included by main Makefile & the  modules
 #
 
 #
 # Uses: NAME, ALLDEP, CC, CFLAGS, DEFS, LIBS, MKDEP, auto_gen, depends, objs
 # (all this must  be defined previously!,  see Makefile.defs & Makefile)
 #
 
 
 
 #implicit rules
 %.o:%.c $(ALLDEP)
 	$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
 
 %.d: %.c $(ALLDEP)
 	@set -e; $(MKDEP) $< \
 	|  sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
 	[ -s $@ ] || rm -f $@
 
 
 # normal rules
dcb5f364
 $(NAME): $(objs) $(ALLDEP)
404073d3
 	$(LD) $(LDFLAGS) $(objs) $(extra_objs) $(LIBS) -o $(NAME) 
247c2b65
 
 
 .PHONY: all
 all: $(NAME) modules
 
 .PHONY: dep
 dep: $(depends)
 
404073d3
 .PHONY: static
 static: $(objs)
 
247c2b65
 .PHONY: clean
 clean:
 	-@rm $(objs) $(NAME) 2>/dev/null
 	-@for r in $(modules); do $(MAKE) -C $$r clean ; done
 
 
 
 .PHONY: proper
 .PHONY: distclean
 .PHONY: realclean
 proper realclean distclean: clean 
 	-@rm $(depends) 2>/dev/null
 	-@for r in $(modules); do $(MAKE) -C $$r proper ; done
 
 .PHONY: mantainer-cleaan
 mantainer-clean: distclean
 	-rm $(auto_gen) TAGS tags *.dbg .*.swp
 	-@for r in $(modules); do $(MAKE) -C $$r mantainer-clean ; done
 
 .PHONY: TAGS
 TAGS:
 	$(MKTAGS) 
 	
 
 ifneq (,$(filter-out clean proper distclean realclean mantainer-clean TAGS \
d4f2d8b0
 		tar modules, $(MAKECMDGOALS)))
247c2b65
 include $(depends)
 endif