1 ###########################################################
2 ### Makefile.rules for the SDCC/PIC14 Library
4 ### Copyright (C) 2005 by Raphael Neider <rneider AT web.de>
6 ### The library is currently maintained by
7 ### Raphael Neider <rneider AT web.de>
9 ### This file may be distributed under the terms of the the
10 ### GNU General Public License (GPL). See GPL for details.
12 ### $Id: Makefile.rules 5205 2008-08-07 21:44:41Z borutr $
16 $(top_builddir)/$(builddir)/%.d : %.c
18 @echo "[ CPP ] ==> $(patsubst $(top_builddir)/%,%,$@)"
20 $(Q)$(CPP) $(CPPFLAGS) -o "$@" "$<"
23 $(top_builddir)/$(builddir)/%.o : %.S
25 @echo "[ AS ] ==> $(patsubst $(top_builddir)/%,%,$@)"
27 $(Q)$(CPP) $(CPPFLAGS) -P -o "$*.Spp" "$<"
28 $(Q)$(AS) $(ASFLAGS) -o "$@" -c "$*.Spp"
32 $(top_builddir)/$(builddir)/%.o : %.c
34 @echo "[ CC ] ==> $(patsubst $(top_builddir)/%,%,$@)"
36 $(Q)$(CC) $(CFLAGS) -o "$@" -c "$<"
39 ifneq (,$(strip $(LIB_O)))
42 @echo "[ LIB ] $(patsubst $(top_builddir)/%,%,$@) <== $(patsubst $(top_builddir)/$(builddir)/%,%,$^)"
44 $(Q)$(RM) "$@"; $(LIB) $(LIBFLAGS) "$@" $^
48 @echo "[ LIB ] $(patsubst $(top_builddir)/%,%,$@) <== **/*.o"
50 $(Q)$(RM) "$@"; LIB_O=`find "$(top_builddir)/$(builddir)" -name "*.o"`; [ "x$${LIB_O}" = "x" ] || $(LIB) $(LIBFLAGS) "$@" $${LIB_O}
53 .PHONY : recurse force
55 # build sub-directories
56 ifneq (,$(strip $(SUBDIRS)))
58 $(Q)+for DIR in $(SUBDIRS) ; do \
59 [ -f "$(srcdir)/$${DIR}.ignore" ] && $(GREP) "^$${ARCH}$$" "$${DIR}.ignore" > /dev/null 2>&1 || ( \
60 $(MKDIR) "$(top_builddir)/$(builddir)/$${DIR}"; \
61 CFLAGS="$(CFLAGS)" $(MAKE) -C "$${DIR}" builddir="$(builddir)/$${DIR}" $(MAKECMDGOALS); \
69 # target to force remaking of (seemingly) independent targets