# Makefile export SPF_CONF := $(shell pwd)/conf TCL_DIR := $(SPF_CONF)/tcl TCL_INC := $(TCL_DIR)/include TCL_LIB := $(TCL_DIR)/lib ifneq ($(filter debug, $(MAKECMDGOALS)),) EFENCE_DIR := $(SPF_CONF)/electric-fence EFENCE_LIB := $(EFENCE_DIR)/lib CFLAGS := -g3 -ggdb LDFLAGS := -lefence -L$(EFENCE_LIB) -Wl,-R$(EFENCE_LIB) endif CFLAGS += -Wall all: ntk.so ntk.so: ntk.o $(CC) -o $@ $^ -L$(TCL_LIB) -Wl,-R$(TCL_LIB) -ltcl8.5 -lm -shared $(LDFLAGS) ntk.o: ntk.c $(CC) -c -o $@ $< -I$(TCL_INC) -fPIC $(CFLAGS) $(CPPFLAGS) clean: -rm -f ntk.so ntk.o run: all demo.tcl -./demo.tcl debug: clean all .PHONY: all clean run debug # vim: set ts=4 sw=4 tw=80 noet: