aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormescalinum <mescalinum@users.sourceforge.net>2009-08-29 17:07:13 +0000
committermescalinum <mescalinum@users.sourceforge.net>2009-08-29 17:07:13 +0000
commit8b65741620bae448b96eb8ce59b85a7b1bb36c44 (patch)
tree6b22e262f1152965a656855478c4ad1a9c58aef0 /Makefile
parent066a639c0bb28d759c017ab2e00624dfb0a64b3f (diff)
tidy up!
svn path=/trunk/externals/tclpd/; revision=12133
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 28 insertions, 20 deletions
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)