Splash function: Fixed several bugs and problems: (1) Off-by-one bug caused a buffer...
[Rockbox.git] / tools / make.inc
blob344fa2354304d26105e05e49a1f0c08f68613b5e
1 # -*- Makefile -*-
3 ifndef V
4 SILENT=@
5 endif
7 $(OBJDIR)/%.o: %.c
8         $(SILENT)mkdir -p `dirname $@`
9         @echo "CC $<"
10         $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
12 $(OBJDIR)/%.o: %.S
13         $(SILENT)mkdir -p `dirname $@`
14         @echo "CC $<"
15         $(SILENT)$(CC) $(CFLAGS) -c $< -o $@
17 # The echo stuff last in the dep update shell magic is to prevent any compiler
18 # errors/warnings to cause an error code to get returned and thus stop the
19 # build
21 # This script checks for the presence of $(BUILDDIR)/lang.h and if it doesn't
22 # alreay exist, it is created. This is because lots of files include this
23 # *generated* file and if it doesn't exist when we generate the deps it is no
24 # good. There's a -MG compiler option to cover for this case, but it doesn't
25 # play nicely into this as it then adds a dependency to the lang.h file
26 # without the proper path.
28 $(DEPFILE): $(SOURCES)
29         $(SILENT)mkdir -p `dirname $(DEPFILE)`
30         $(SILENT)rm -f $(DEPFILE)
31         $(SILENT)(for each in $(SOURCES) x; do \
32             if test "$$each" = "credits.c"; then \
33                 del="$$del$(BUILDDIR)/credits.raw"; \
34                 touch $(BUILDDIR)/credits.raw; \
35             fi; \
36             if test "x" != "$$each"; then \
37                 obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
38                 $(CC) -MG -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each 2>/dev/null; \
39             fi; \
40             if test -n "$$del"; then \
41                 rm $$del; \
42                 del=""; \
43             fi \
44         done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" > $(DEPFILE); \
45         echo "oo" > /dev/null )
47 tags:
48         $(SILENT)(for d in $(DIRS); do \
49             etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; \
50         done)