From 1e1d2285d538c7fc71e687ce0eb77ea880e113e0 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Sat, 26 Sep 2009 09:03:19 +0000 Subject: beware: (ab)using Makefiles may lead to severe injury to yourself svn path=/trunk/externals/ffext/; revision=12454 --- composer/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/composer/Makefile b/composer/Makefile index 6162234..ce630d5 100644 --- a/composer/Makefile +++ b/composer/Makefile @@ -32,7 +32,7 @@ CFLAGS += -funroll-loops -fno-operator-names -fno-omit-frame-pointer -falign-fun CFLAGS += -DPDSUF=\"$(PDSUF)\" LDSHARED = $(CXX) $(PDBUNDLEFLAGS) -all: $(LIBNAME)$(PDSUF) +all: autogen_sources $(LIBNAME)$(PDSUF) @echo '-----------------------------------------------------------------------------' @echo ' $(LIBNAME)$(PDSUF) ('`test $(DEBUG) -eq 1 && echo debug || echo release`' build) '\ '[size: '`ls -gGh $(LIBNAME)$(PDSUF) | cut -d " " -f 3`']' @@ -40,18 +40,19 @@ all: $(LIBNAME)$(PDSUF) clean:: rm -f $(LIBNAME)$(PDSUF) rm -f *.o *~ - rm -f editor_tk.cpp methods_pd.hpp methods_ed.hpp classsetup.cpp callwrappers_pd.cpp callwrappers_ed.cpp + rm -f $(AUTOGENERATED_SOURCES) + rm -f editor_tk.cpp .SUFFIXES: .cpp .o SRCS = Song.cpp Pattern.cpp Track.cpp Editor.o PdClasses.cpp OBJS = ${SRCS:.cpp=.o} - +AUTOGENERATED_SOURCES = methods.hpp methods_pd.hpp methods_ed.hpp classsetup.cpp callwrappers_pd.cpp callwrappers_ed.cpp Song.o: Song.cpp Song.hpp Pattern.o: Pattern.cpp Pattern.hpp Track.o: Track.cpp Track.hpp Editor.o: Editor.cpp Editor.hpp editor_tk.cpp -PdClasses.o: PdClasses.cpp PdClasses.hpp methods_pd.hpp methods_ed.hpp classsetup.cpp callwrappers_pd.cpp callwrappers_ed.cpp +PdClasses.o: PdClasses.cpp PdClasses.hpp .cpp.o: Makefile $(CXX) $(CFLAGS) $(INCLUDES) -xc++ -c $< @@ -62,6 +63,8 @@ $(LIBNAME)$(PDSUF): Makefile $(OBJS) editor_tk.cpp: editor.tk ( echo 'static const char* editor_tk[] = {'; sed -e 's/\(["\\]\)/\\\1/g' -e 's/^/"/' -e 's/$$/",/' editor.tk; echo '"" };' ) > editor_tk.cpp +autogen_sources: $(AUTOGENERATED_SOURCES) + methods.hpp: PdClasses.hpp awk ' \ /^\/\*#end methods\*\/$$/{M=0} \ @@ -122,8 +125,6 @@ callwrappers_pd.cpp: methods.hpp -e '/\/\/real call/s/(t_track_proxy\* arg0/(arg0/' \ -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ - -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ - -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ > callwrappers_pd.cpp callwrappers_ed.cpp: methods.hpp @@ -135,6 +136,4 @@ callwrappers_ed.cpp: methods.hpp -e '/\/\/real call/s/(t_track_proxy\* arg0/(arg0/' \ -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ - -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ - -e '/\/\/real call/s/\(arg[0-9]\+, \)[A-Za-z_*]\+ \(arg[0-9]\+\)/\1\2/g' \ > callwrappers_ed.cpp -- cgit v1.2.1