rockbox/tools/make.inc
Daniel Stenberg 4a06c87e78 FS#8482:
Build system tweak that builds all languages first, to make the system able
to use a buffer size that fits the larger language only. Parts of this work
done by Jonas Haggqvist, but all the mistakes are my own!


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16337 a1c6a512-1295-4272-9138-f99709370657
2008-02-17 23:12:54 +00:00

50 lines
1.6 KiB
Makefile

# -*- Makefile -*-
ifndef V
SILENT=@
endif
PRINTS=$(SILENT)$(call info,$(1))
$(OBJDIR)/%.o: %.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/%.o: %.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $< -o $@
# The echo stuff last in the dep update shell magic is to prevent any compiler
# errors/warnings to cause an error code to get returned and thus stop the
# build
#
# This script checks for the presence of $(BUILDDIR)/lang.h and if it doesn't
# alreay exist, it is created. This is because lots of files include this
# *generated* file and if it doesn't exist when we generate the deps it is no
# good. There's a -MG compiler option to cover for this case, but it doesn't
# play nicely into this as it then adds a dependency to the lang.h file
# without the proper path.
#
$(DEPFILE): $(SOURCES)
$(SILENT)mkdir -p $(dir $(DEPFILE))
$(SILENT)rm -f $(DEPFILE)
$(SILENT)(for each in $(SOURCES) x; do \
if test "$$each" = "credits.c"; then \
del="$$del$(BUILDDIR)/credits.raw"; \
touch $(BUILDDIR)/credits.raw; \
fi; \
if test "x" != "$$each"; then \
obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
$(CC) -MG -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each 2>/dev/null; \
fi; \
if test -n "$$del"; then \
rm $$del; \
del=""; \
fi \
done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" \
-e "s:[^[:space:]]*sysfont.h:$(BUILDDIR)/sysfont.h:" > $(DEPFILE); \
echo "oo" > /dev/null )
tags:
$(SILENT)(for d in $(DIRS); do \
etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; \
done)