]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - Makefile.in
Introduce clean2 target.
[paraslash.git] / Makefile.in
index ddf3be449d50744e394eb93395254a910c5eb4e3..d71c0c9a2c8b34cd7cb4750b1d6f213970ce8789 100644 (file)
@@ -67,6 +67,7 @@ man_pages := $(patsubst %, man/man1/%.1, $(man_binaries))
 man_pages_in := $(patsubst %, web/%.man.in.html, $(man_binaries))
 
 ggo_dir := ggo
+object_dir := objects
 
 m4_ggos := afh audioc audiod client filter gui recv server write
 all_ggos := $(m4_ggos) dccp_recv oggdec_filter alsa_write oss_write fade http_recv \
@@ -83,16 +84,11 @@ tarball_delete := $(addprefix $(tarball_pfx)/,\
        $(ggo_dir) skencil)
 tarball := @PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2
 
-.PHONY: clean distclean maintainer-clean install man tarball
+.PHONY: all clean distclean maintainer-clean install man tarball
 all: $(BINARIES) $(man_pages)
 man: $(man_pages)
 tarball: $(tarball)
 
-*.o: para.h config.h gcc-compat.h
-
-Makefile.deps: $(wildcard *.c *.h) $(cmdline_generated)
-       gcc -MM -MG -I$(cmdline_dir) @faad_cppflags@ @mad_cppflags@ @oggvorbis_cppflags@ *.c > $@
--include Makefile.deps
 -include $(ggo_dir)/makefile
 
 %_command_list.c: %.cmd
@@ -125,75 +121,103 @@ man/html/%.html: man/man1/%.1
 web/%.man.in.html: man/man1/%.1
        man2html $< | sed -e '/^<\/BODY>/,$$d' -e '1,/<\/HEAD><BODY>/d' > $@
 
+$(object_dir):
+       mkdir -p $@
+
+$(object_dir)/oggdec_filter.o: oggdec_filter.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
 
-oggdec_filter.o: oggdec_filter.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
-ogg_afh.o: ogg_afh.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
+$(object_dir)/ogg_afh.o: ogg_afh.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
 
-mp3dec_filter.o: mp3dec_filter.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
+$(object_dir)/mp3dec_filter.o: mp3dec_filter.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
 
-aacdec_filter.o: aacdec_filter.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+$(object_dir)/aacdec_filter.o: aacdec_filter.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
-aac_common.o: aac_common.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+$(object_dir)/aac_common.o: aac_common.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
-aac_afh.o: aac_afh.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
+$(object_dir)/aac_afh.o: aac_afh.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
 
-$(cmdline_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c
-       @mkdir -p $(cmdline_dir)
+$(object_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h | $(object_dir)
        $(CC) -c $(CPPFLAGS) -o $@ $<
 
-%.o: %.c
-       $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
+$(object_dir)/%.o: %.c | $(object_dir)
+       $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
+
+# We depend on the *.cmdline.[ch] files as these must be present for depend.sh
+# to work. The first dependency is explititly given as it is used by $<.
+$(object_dir)/%.cmdline.d: %.cmdline.c $(cmdline_generated) | $(object_dir)
+       ./depend.sh $(object_dir) $(CPPFLAGS) $< > $@
+$(object_dir)/%.d: %.c $(cmdline_generated) | $(object_dir)
+       ./depend.sh  $(object_dir) $(CPPFLAGS) $< > $@
+
+recv_objs := $(addprefix $(object_dir)/, @recv_objs@)
+filter_objs := $(addprefix $(object_dir)/, @filter_objs@)
+client_objs := $(addprefix $(object_dir)/, @client_objs@)
+gui_objs := $(addprefix $(object_dir)/, @gui_objs@)
+audiod_objs := $(addprefix $(object_dir)/, @audiod_objs@)
+audioc_objs := $(addprefix $(object_dir)/, @audioc_objs@)
+fade_objs := $(addprefix $(object_dir)/, @fade_objs@)
+server_objs := $(addprefix $(object_dir)/, @server_objs@)
+write_objs := $(addprefix $(object_dir)/, @write_objs@)
+afh_objs := $(addprefix $(object_dir)/, @afh_objs@)
 
-para_recv: @recv_objs@
-       $(CC) $(LDFLAGS) @recv_objs@ -o $@ @recv_ldflags@
+all_objs := $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
+       $(audiod_objs ) $(audioc_objs) $(fade_objs) $(server_objs) \
+       $(write_objs) $(afh_objs)
+-include $(all_objs:.o=.d)
 
-para_filter: @filter_objs@
-       $(CC) $(LDFLAGS) @filter_objs@ -o $@ @filter_ldflags@
+para_recv: $(recv_objs)
+       $(CC) $(LDFLAGS) $(recv_objs) -o $@ @recv_ldflags@
 
-para_client: @client_objs@
-       $(CC) $(LDFLAGS) -o $@ @client_objs@ @client_ldflags@
+para_filter: $(filter_objs)
+       $(CC) $(LDFLAGS) $(filter_objs) -o $@ @filter_ldflags@
 
-para_gui: @gui_objs@
-       $(CC) $(LDFLAGS) -o $@ @gui_objs@ -lncurses
+para_client: $(client_objs)
+       $(CC) $(LDFLAGS) -o $@ $(client_objs) @client_ldflags@
 
-para_audiod: @audiod_objs@ audiod_command_list.c audiod_command_list.h
-       $(CC) $(LDFLAGS) -o $@ @audiod_objs@ @audiod_ldflags@
+para_gui: $(gui_objs)
+       $(CC) $(LDFLAGS) -o $@ $(gui_objs) -lncurses
 
-para_audioc: @audioc_objs@
-       $(CC) $(LDFLAGS) -o $@ @audioc_objs@ @audioc_ldflags@
+para_audiod: audiod_command_list.c audiod_command_list.h $(audiod_objs)
+       $(CC) $(LDFLAGS) -o $@ $(audiod_objs) @audiod_ldflags@
 
-para_fade: @fade_objs@
-       $(CC) $(LDFLAGS) -o $@ @fade_objs@ @fade_ldflags@
+para_audioc: $(audioc_objs)
+       $(CC) $(LDFLAGS) -o $@ $(audioc_objs) @audioc_ldflags@
 
-para_server: @server_objs@ $(server_command_lists_ch)
-       $(CC) $(LDFLAGS) -o $@ @server_objs@  @server_ldflags@
+para_fade: $(fade_objs)
+       $(CC) $(LDFLAGS) -o $@ $(fade_objs) @fade_ldflags@
 
-para_write: @write_objs@
-       $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@
+para_server: $(server_command_lists_ch) $(server_objs)
+       $(CC) $(LDFLAGS) -o $@ $(server_objs)  @server_ldflags@
 
-para_afh: @afh_objs@
-       $(CC) $(LDFLAGS) -o $@ @afh_objs@ @afh_ldflags@
+para_write: $(write_objs)
+       $(CC) $(LDFLAGS) -o $@ $(write_objs) @write_ldflags@
+
+para_afh: $(afh_objs)
+       $(CC) $(LDFLAGS) -o $@ $(afh_objs) @afh_ldflags@
 
 clean:
-       rm -f *.o $(BINARIES)
+       rm -f $(BINARIES) $(object_dir)/*.o
+
+clean2: clean
+       rm -rf man $(object_dir)
        rm -f *_command_list.*
-       rm -rf man
-distclean: clean
+
+distclean: clean2
        rm -f Makefile autoscan.log config.status config.log && \
-       rm -rf web/sync/* autom4te.cache aclocal.m4
+       rm -rf autom4te.cache aclocal.m4
        rm -f GPATH GRTAGS GSYMS GTAGS
 
 maintainer-clean: distclean
        rm -f $(ggo_generated) *.tar.bz2 \
                config.h configure \
                config.h.in skencil/*.pdf skencil/*.ps
-       rm -rf web_sync
+       rm -rf web_sync $(cmdline_dir)
 
 install: all man
        mkdir -p $(BINDIR) $(MANDIR)