From 8b65741620bae448b96eb8ce59b85a7b1bb36c44 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Sat, 29 Aug 2009 17:07:13 +0000 Subject: tidy up! svn path=/trunk/externals/tclpd/; revision=12133 --- Makefile | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1aa6ea2..4c40052 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,11 @@ #!/usr/bin/make DEBUG=1 -TCL_VERSION := $(shell echo 'puts $$tcl_version' | tclsh) -INCLUDES = -I../../pd/src -I/usr/include -I/usr/include/tcl$(TCL_VERSION) -CFLAGS += $(INCLUDES) -xc++ -funroll-loops -fno-operator-names -fno-omit-frame-pointer -falign-functions=16 -O2 -Wall -fPIC +OS = linux + ifeq ($(DEBUG),1) CFLAGS += -O0 -g -ggdb -DDEBUG endif -LDSOFLAGS += -lm -ltcl$(TCL_VERSION) -CXX = g++ -OS = linux -LDSHARED = $(CXX) $(PDBUNDLEFLAGS) - -all:: tcl - -clean:: - rm -f tcl.pd_linux tcl_wrap.cxx *.o *~ - -.SUFFIXES: - ifeq ($(OS),darwin) PDSUF = .pd_darwin PDBUNDLEFLAGS = -bundle -flat_namespace -undefined dynamic_lookup @@ -32,11 +19,32 @@ else endif endif -tcl:: tcl.pd_linux +LIBNAME = tcl +TCL_VERSION := $(shell echo 'puts $$tcl_version' | tclsh) +INCLUDES = -I../../pd/src -I/usr/include -I/usr/include/tcl$(TCL_VERSION) +CFLAGS += -funroll-loops -fno-operator-names -fno-omit-frame-pointer -falign-functions=16 -O2 -Wall -fPIC +CFLAGS += -DPDSUF=\"$(PDSUF)\" +LDSOFLAGS += -lm -ltcl$(TCL_VERSION) +LDSHARED = $(CXX) $(PDBUNDLEFLAGS) + +all:: $(LIBNAME)$(PDSUF) + @echo '-----------------------------------------------------------------------------' + @echo ' $(LIBNAME)$(PDSUF) ('`test $(DEBUG) -eq 1 && echo debug || echo release`' build) '\ + '[size: '`ls -gGh $(LIBNAME)$(PDSUF) | cut -d " " -f 3`']' -tcl.pd_linux: tcl_wrap.cxx tcl_extras.cxx tcl_loader.cxx tcl_extras.h Makefile - $(LDSHARED) $(CFLAGS) -DPDSUF=\"$(PDSUF)\" -o tcl$(PDSUF) \ - tcl_wrap.cxx tcl_extras.cxx tcl_loader.cxx $(LDSOFLAGS) +clean:: + rm -f tcl.pd_linux tcl_wrap.cxx *.o *~ + +.SUFFIXES: .cxx .o -tcl_wrap.cxx: tcl.i tcl_extras.h +SRCS = tcl_wrap.cxx tcl_typemap.cxx tcl_class.cxx tcl_setup.cxx tcl_loader.cxx +OBJS = ${SRCS:.cxx=.o} + +tcl_wrap.cxx:: tcl.i tcl_extras.h Makefile swig -v -c++ -tcl -o tcl_wrap.cxx $(INCLUDES) tcl.i + +.cxx.o:: tcl_extras.h Makefile + $(CXX) $(CFLAGS) $(INCLUDES) -xc++ -c $< + +$(LIBNAME)$(PDSUF):: tcl_extras.h Makefile $(OBJS) + $(LDSHARED) $(CFLAGS) -o $(LIBNAME)$(PDSUF) $(OBJS) $(LDSOFLAGS) -- cgit v1.2.1