1 # base code for various Tcl extensions
2 # Copyright 2006-2012 Ian Jackson
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses/>.
19 EXTPREFIX ?= $(FAMILY)_
20 EXTENSION ?= $(EXTPREFIX)$(EXTBASE)
21 SHLIB ?= $(EXTENSION)-$(VERSION)
24 AUTO_HDRS += $(TABLE)+tcmdif.h
25 AUTO_SRCS += $(TABLE)+tcmdif.c
26 CFILES += $(TABLE)+tcmdif
28 CPPFLAGS += $(foreach o, $(OTHER_EXTS), -I../$(dir $o))
29 LDLIBS += $(foreach o, $(OTHER_EXTS), ../$(dir $o)$(EXTPREFIX)$(notdir $o)-$(VERSION).so)
31 LDLIBS += $(BASE_DIR)/$(BASE_SHLIB).so
33 include $(BASE_DIR)/common.make
34 include $(BASE_DIR)/shlib.make
36 TCMDIFARGS ?= -p$(FAMILY)_$(EXTBASE) -o$@ $(BASE_TCT) $(OTHER_TCTS) $<
38 %+tcmdif.c: %.tct $(BASE_TCT) $(OTHER_TCTS) $(TCMDIFGEN)
39 $(TCMDIFGEN) -wc $(TCMDIFARGS)
41 %+tcmdif.h: %.tct $(BASE_TCT) $(OTHER_TCTS) $(TCMDIFGEN)
42 $(TCMDIFGEN) -wh $(TCMDIFARGS)
44 OTHER_DIRS += ../base/
45 OTHER_DIRS += $(addprefix ../,$(dir $(OTHER_EXTS)))
52 echo >$@ "load $(SHLIB).so"
54 test-load: $(SHLIB).so $(SHLIB).test.tcl
55 @set -x; LD_LIBRARY_PATH=$(subst $(space),:,$(strip $(OTHER_DIRS)))$${LD_LIBRARY_PATH+:}$${LD_LIBRARY_PATH} \
56 tclsh$(TCL_VERSION) $(SHLIB).test.tcl
58 include $(BASE_DIR)/final.make