]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - Makefile.real
build: Remove depend.sh.
[paraslash.git] / Makefile.real
index 71f066793beeec0254f42dbddc3d647d7c7fe2cf..9ba29774c9d16949cae8a3ae23ea3e01f18b7095 100644 (file)
@@ -244,10 +244,15 @@ $(object_dir)/%.cmdline.o: $(cmdline_dir)/%.cmdline.c $(cmdline_dir)/%.cmdline.h
        @[ -z "$(Q)" ] || echo 'CC $<'
        $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
 
-$(dep_dir)/%.d: %.c error2.h | $(dep_dir) $(cmdlist_dir)
+# The compiler outputs dependencies either as foo.h or as some_directory/foo.h,
+# depending on whether the latter file exists. Since make needs the directory
+# part we prefix the dependency as appropriate.
+$(dep_dir)/%.d: %.c error2.h | $(dep_dir)
        @[ -z "$(Q)" ] || echo 'DEP $<'
-       $(Q) ./depend.sh $(dep_dir) $(object_dir) $(cmdline_dir) \
-               $(cmdlist_dir) $(CPPFLAGS) $< > $@
+       $(Q) $(CC) $(CPPFLAGS) -MM -MG -MP -MT $@ -MT $(object_dir)/$(*F).o $< \
+               | sed -e "s@ \([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $(cmdline_dir)/\1@g" \
+               -e "s@ \([a-zA-Z0-9_]\{1,\}\.command_list.h\)@ $(cmdlist_dir)/\1@g" \
+               -e "s@ \([a-zA-Z0-9_]\{1,\}\.completion.h\)@ $(cmdlist_dir)/\1@g" > $@
 
 para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
 para_write para_play para_audiod: LDFLAGS += $(ao_ldflags) $(core_audio_ldflags)
@@ -306,7 +311,7 @@ $(prefixed_executables):
 
 clean:
        @[ -z "$(Q)" ] || echo 'CLEAN'
-       $(Q) rm -f $(prefixed_executables)
+       $(Q) rm -f para_*
        $(Q) rm -rf $(object_dir)
 
 clean2: clean