[PD-dev] [PATCH] made automake system kind-of work

IOhannes m zmoelnig zmoelnig at iem.at
Thu Jul 15 11:19:48 CEST 2010


this is a little addendum to make miller's inclusion of the automake-based build
system actually work.

autogen.sh: now creates ./m4 directory if necessary
Makefile.am: include tcl
tcl/Makefile: installs tcl-files into .../pd/tcl/
po/Makefile: fixed the paths (tcl-files no longer in ./src)
src/Makefile: removed tcl-files (no longer here)
extra/expr~/makefile: fixed typo in the clean target
extra/makefile: added targets to be called directly from ./extra

handcrafted (non-automake) Makefiles now have supprt for rudimentary standard
targets, like "install".
---
 Makefile.am          |    3 ++-
 autogen.sh           |    7 +++++++
 extra/expr~/makefile |    9 ++++-----
 extra/makefile       |   35 +++++++++++++++++++++++++++++++++--
 po/Makefile          |   22 ++++++++++++----------
 src/Makefile.am      |   16 ++++------------
 tcl/Makefile         |   40 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 102 insertions(+), 30 deletions(-)
 create mode 100644 tcl/Makefile

diff --git a/Makefile.am b/Makefile.am
index 2cd7bf1..7a626d6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,7 +23,7 @@ EXTRA_DIST = LICENSE.txt README.txt INSTALL.txt
 SUBDIRS = $(EXTRA_SUBDIRS) src extra man
 
 # subdirs that are always included in the dist, etc.
-DIST_SUBDIRS = asio extra man po portaudio portmidi src
+DIST_SUBDIRS = asio extra man po portaudio portmidi src tcl
 
 # bin and tcl are symlinks for compatibility with the Pd-vanilla source tree.
 # Symlinks don't work on Windows/MinGW but they do on Cygwin.
@@ -56,6 +56,7 @@ clean-local:
 
 install-data-local:
 	make libpddir=$(libpddir) -C po install
+	make libpddir=$(libpddir) -C tcl install
 	make libpddir=$(libpddir) -C extra install
 	$(INSTALL) -d $(DESTDIR)$(libpddir)/startup
 	$(INSTALL) -d $(DESTDIR)$(libpddir)/startup/disabled
diff --git a/autogen.sh b/autogen.sh
index 582ecb1..a57907f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -2,6 +2,13 @@
 
 PATH=/sw/bin:$PATH
 
+PWD=${0%/*}
+
+
+## git cannot really handle empty directories
+## so let's create the missing ones
+mkdir -p ${PWD}/m4
+
 case `uname -s` in
     MINGW*)
 # autoreconf doesn't always work on MinGW
diff --git a/extra/expr~/makefile b/extra/expr~/makefile
index 892b0a7..5dee147 100644
--- a/extra/expr~/makefile
+++ b/extra/expr~/makefile
@@ -6,7 +6,7 @@ install: install_linux
 
 clean: clean_linux
 
-PDEXTERN=/usr/local/lib/pd/externs
+PDEXTERN=/usr/local/lib/pd/extra
 
 # ----------------------- NT -----------------------
 
@@ -109,12 +109,11 @@ install_linux:
 	install expr.pd_linux $(PDEXTERN)
 	rm -f $(PDEXTERN)/expr~.pd_linux
 	rm -f $(PDEXTERN)/fexpr~.pd_linux
-	cd $(PDEXTERN); \
-	-ln -s expr.pd_linux expr~.pd_linux
-	-ln -s expr.pd_linux fexpr~.pd_linux
+	cd $(PDEXTERN); ln -s expr.pd_linux expr~.pd_linux
+	cd $(PDEXTERN); ln -s expr.pd_linux fexpr~.pd_linux
 
 
-linux_clean:
+clean_linux:
 	rm -f *.pd_linux_o *.o
 
 # ----------------------- MAC OSX -----------------------
diff --git a/extra/makefile b/extra/makefile
index ddbba77..b176f83 100644
--- a/extra/makefile
+++ b/extra/makefile
@@ -1,3 +1,10 @@
+# this is the UNIX-style complicated layout dir, simple goes to $(prefix)/po
+prefix = /usr/local
+libpddir = $(prefix)/lib/pd
+
+EXTERNALS=bonk~ choice expr~ fiddle~ loop~ lrshift~ pd~ pique sigmund~ stdout
+.PHONY: $(EXTERNALS)
+
 current: pd_linux
 
 # ----------------------- NT -----------------------
@@ -63,5 +70,29 @@ DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
 
 # ----------------------------------------------------------
 
-clean:
-	rm -f *.o *.pd_* so_locations
+distclean clean: clean-externals
+	rm -f *.o *.pd_* *.l_* *.d_* *.m_* so_locations
+
+# ----------------------------------------------------------
+# ----------------------------------------------------------
+
+$(EXTERNALS): 
+	if test -d $@; then make -C $@; fi
+
+$(EXTERNALS:%=%-clean): 
+	if test -d $(@:-clean=); then make -C $(@:-clean=) clean; fi
+
+$(EXTERNALS:%=%-install): 
+	if test -d $(@:-install=); then make -C $(@:-install=) install; fi
+
+all: $(EXTERNALS)
+
+clean-externals: $(EXTERNALS:%=%-clean)
+
+install: $(EXTERNALS:%=%-install)
+	install -d $(DESTDIR)$(libpddir)/extra/$(NAME)
+	install -m644 -p *.*_* $(DESTDIR)$(libpddir)/extra/$(NAME)
+	install -m644 -p *.pd $(DESTDIR)$(libpddir)/extra/$(NAME)
+
+test:
+	@echo prefix: $(prefix)
diff --git a/po/Makefile b/po/Makefile
index 7a91a7c..9ffd2ff 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -8,15 +8,17 @@ ifeq ($(UNAME),Darwin)
 endif
 
 # these are the files to search for localization strings
-SOURCES = ../src/AppMain.tcl ../src/apple_events.tcl ../src/dialog_array.tcl \
-	../src/dialog_audio.tcl ../src/dialog_canvas.tcl ../src/dialog_data.tcl \
-	../src/dialog_find.tcl ../src/dialog_font.tcl ../src/dialog_gatom.tcl \
-	../src/dialog_iemgui.tcl ../src/dialog_message.tcl ../src/dialog_midi.tcl \
-	../src/dialog_path.tcl ../src/dialog_startup.tcl ../src/helpbrowser.tcl \
-	../src/opt_parser.tcl ../src/pd-gui.tcl ../src/pd_bindings.tcl \
-	../src/pd_connect.tcl ../src/pd_menucommands.tcl ../src/pd_menus.tcl \
-	../src/pdtk_canvas.tcl ../src/pdtk_text.tcl ../src/pdwindow.tcl \
-	../src/scrollbox.tcl ../src/scrollboxwindow.tcl ../src/wheredoesthisgo.tcl
+TCLSOURCES = AppMain.tcl apple_events.tcl dialog_array.tcl \
+	dialog_audio.tcl dialog_canvas.tcl dialog_data.tcl \
+	dialog_find.tcl dialog_font.tcl dialog_gatom.tcl \
+	dialog_iemgui.tcl dialog_message.tcl dialog_midi.tcl \
+	dialog_path.tcl dialog_startup.tcl helpbrowser.tcl \
+	opt_parser.tcl pd-gui.tcl pd_bindings.tcl \
+	pd_connect.tcl pd_menucommands.tcl pd_menus.tcl \
+	pdtk_canvas.tcl pdtk_text.tcl pdwindow.tcl \
+	scrollbox.tcl scrollboxwindow.tcl wheredoesthisgo.tcl
+
+SOURCES=$(addprefix ../tcl/, $(TCLSOURCES))
 
 # these are the supported languages, 
 ALL_LINGUAS = af az be bg de el en_ca eu fr gu he hi hu it pa pt_br pt_pt sq sv vi
@@ -69,7 +71,7 @@ distdir:
 	install -m644 -p $(TEMPLATE) $(distdir)
 	install -m644 -p $(POFILES) $(distdir)
 
-distclean: clean
+maintainer-clean distclean: clean
 
 clean:
 	-rm -f -- $(MSGFILES)
diff --git a/src/Makefile.am b/src/Makefile.am
index 4161a06..60ca008 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,20 +30,12 @@ pd_SOURCES = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c \
     x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
     x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c d_soundfile.c
 
-TCL_FILES = AppMain.tcl apple_events.tcl dialog_array.tcl dialog_audio.tcl \
-	dialog_canvas.tcl dialog_data.tcl dialog_find.tcl dialog_font.tcl \
-	dialog_gatom.tcl dialog_iemgui.tcl dialog_message.tcl dialog_midi.tcl \
-	dialog_path.tcl dialog_startup.tcl helpbrowser.tcl opt_parser.tcl \
-	pd-gui.tcl pd_bindings.tcl pd_connect.tcl pd_menucommands.tcl pd_menus.tcl \
-	pdtk_canvas.tcl pdtk_text.tcl pdwindow.tcl pkgIndex.tcl scrollbox.tcl \
-	scrollboxwindow.tcl wheredoesthisgo.tcl
-
 include_HEADERS = m_pd.h m_imp.h g_canvas.h s_stuff.h
 noinst_HEADERS = g_all_guis.h s_audio_alsa.h s_audio_pablio.h s_audio_paring.h
 
 
 # we want these in the dist tarball
-EXTRA_DIST = CHANGELOG.txt notes.txt makefile.mingw $(TCL_FILES)
+EXTRA_DIST = CHANGELOG.txt notes.txt makefile.mingw
 
 # configurations per library
 if ALSA
@@ -111,7 +103,7 @@ if LINUX
 pd_CFLAGS += -DUNIX 
 
 libpdbindir = $(pkglibdir)/bin
-libpdbin_DATA = $(TCL_FILES)
+libpdbin_DATA = 
 # this flag has to have a single leading "-" for libtool, even though ld uses
 # --export-dynamic, and libtool sends -Wl,--export-dynamic to ld...
 pd_LDFLAGS += -export-dynamic
@@ -122,14 +114,14 @@ endif
 if MACOSX
 LIBS += -framework Carbon
 pd_CFLAGS += -DMACOSX #kludge, should use auto macro __APPLE__
-bin_SCRIPTS = $(TCL_FILES)
+bin_SCRIPTS = 
 endif
 
 if WINDOWS
 LIBS += -lwsock32 -lwinmm -lole32
 pd_CFLAGS +=  -DUSEAPI_MMIO -DPD_INTERNAL
 pd_SOURCES += s_audio_mmio.c s_midi_mmio.c
-bin_SCRIPTS = $(TCL_FILES)
+bin_SCRIPTS = 
 endif
 
 # Cygwin is not _WIN32 and MSW vaguely means the same thing, so MINGW only
diff --git a/tcl/Makefile b/tcl/Makefile
new file mode 100644
index 0000000..2e26168
--- /dev/null
+++ b/tcl/Makefile
@@ -0,0 +1,40 @@
+# this is the UNIX-style complicated layout dir, simple goes to $(prefix)/po
+libpddir = $(prefix)/lib/pd
+
+# these are the files to search for localization strings
+APPSOURCES = pd-gui.tcl
+MODSOURCES = AppMain.tcl apple_events.tcl dialog_array.tcl \
+	dialog_audio.tcl dialog_canvas.tcl dialog_data.tcl \
+	dialog_find.tcl dialog_font.tcl dialog_gatom.tcl \
+	dialog_iemgui.tcl dialog_message.tcl dialog_midi.tcl \
+	dialog_path.tcl dialog_startup.tcl helpbrowser.tcl \
+	opt_parser.tcl pd_bindings.tcl \
+	pd_connect.tcl pd_menucommands.tcl pd_menus.tcl \
+	pdtk_canvas.tcl pdtk_text.tcl pdwindow.tcl \
+	scrollbox.tcl scrollboxwindow.tcl wheredoesthisgo.tcl \
+	pkgIndex.tcl
+
+SOURCES = $(APPSOURCES) $(MODSOURCES)
+
+.SUFFIXES = .tcl
+.PHONY = all install clean
+
+# nothing todo
+all: 
+
+install: $(MSGFILES)
+	install -d $(DESTDIR)$(libpddir)/tcl
+	install -p $(APPSOURCES) $(DESTDIR)$(libpddir)/tcl
+	install -m644 -p $(MODSOURCES) $(DESTDIR)$(libpddir)/tcl
+
+distdir:
+	install -m644 -p Makefile $(distdir)
+	install -p $(APPSOURCES) $(distdir)
+	install -m644 -p $(MODSOURCES) $(distdir)
+
+maintainer-clean distclean: clean
+
+clean:
+	-rm -f -- $(SOURCES:=~)
+
+
-- 
1.7.1




More information about the Pd-dev mailing list