One more gapless fix for LAME MP3 files.
[kugel-rb.git] / tools / make.inc
blobb5eae4430e27b16ab69abbf7834829c7f349b73a
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)(if test ! -f $(BUILDDIR)/lang.h; then \
32           touch $(BUILDDIR)/lang.h; \
33         fi; \
34         for each in $(SOURCES) x; do \
35           if test "x" != "$$each"; then \
36             obj=`echo $$each | sed -e 's/\.[cS]/.o/'`; \
37             $(CC) -MM -MT "$(OBJDIR)/$$obj" $(CFLAGS) $$each >> $(DEPFILE) 2>/dev/null; \
38           fi; \
39         done; \
40         echo "oo" >/dev/null )
42 tags:
43         $(SILENT)(for d in $(DIRS); do \
44             etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; \
45         done)