
###############################################################################
# MODULE     : Make file for maple plugin
# COPYRIGHT  : (C) 1999-2008  Joris van der Hoeven
###############################################################################
# This software falls under the GNU general public license version 3 or later.
# It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
# in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
###############################################################################

CC = gcc

#TEXMACS_HOME_PATH = $(HOME)/.TeXmacs
#TEXMACS_MAPLE_DIR = $(shell realpath `which maple` | sed -e 's%/bin/maple$$%%')

#MAPLE_CPPFLAGS = -I$(TEXMACS_MAPLE_DIR)/extern/include
#MAPLE_LDFLAGS = -L$(TEXMACS_MAPLE_DIR)/bin.IBM_INTEL_LINUX -Wl,-rpath,$(TEXMACS_MAPLE_DIR)/bin.IBM_INTEL_LINUX -lmaplec

all: $(TEXMACS_HOME_PATH)/bin/tm_maple_9.sh $(TEXMACS_HOME_PATH)/bin/tm_maple_9

$(TEXMACS_HOME_PATH)/bin/tm_maple_9.sh: $(TEXMACS_MAPLE_DIR)/bin/maple
	cat $(TEXMACS_MAPLE_DIR)/bin/maple | sed 's%$${MAPLE}/$$MAPLE_SYS_BIN/cmaple%$${HOME}/.TeXmacs/bin/tm_maple_9%' | sed 's%$${MAPLE}/$$MAPLE_SYS_BIN/maplew%$${HOME}/.TeXmacs/bin/tm_maple_9%' > $(TEXMACS_HOME_PATH)/bin/tm_maple_9.sh
	chmod a+x $(TEXMACS_HOME_PATH)/bin/tm_maple_9.sh

$(TEXMACS_HOME_PATH)/bin/tm_maple_9: src.9/tm_maple_9.c
	$(CC) $(MAPLE_LDFLAGS) $(MAPLE_CPPFLAGS) src.9/tm_maple_9.c -o $(TEXMACS_HOME_PATH)/bin/tm_maple_9
