[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / OpenXM / rc

File: [local] / OpenXM / rc / Makefile (download)

Revision 1.23, Sun Jun 20 04:55:32 2004 UTC (19 years, 10 months ago) by takayama
Branch: MAIN
Changes since 1.22: +48 -27 lines

New targets
   install-under-prefix,  copy-non-free, copy-free
They relocate  OpenXM under ${prefix}/OpenXM.
This is a preparation for generating Debian and Fink package
  openxm-non-free.deb  and openxm-free.deb

# $OpenXM: OpenXM/rc/Makefile,v 1.23 2004/06/20 04:55:32 takayama Exp $
# make install-under-prefix  [ prefix=/home/hoge ]  ; Default is /usr/local
prefix=/usr/local
CC=gcc
# SHELL_SCRIPTS=asir sm1 oxgp k0 oxmath oxMathematica ox
SHELL_SCRIPTS=asir sm1 oxmath oxMathematica ox openxm webasir
INSTALL_DIR=${prefix}/bin
MAN_DIR=../man/man1
KDE_MENU_DIR=/usr/lib/menu

all-trad :  dot.bashrc  dot.cshrc .done_gen-shell-scripts

dot.bashrc : bashrc repl 
	rm -f dot.bashrc 
	echo "# DO NOT EDIT THIS FILE" >dot.bashrc
	./repl bash <bashrc >>dot.bashrc

dot.cshrc : cshrc repl
	rm -f dot.cshrc 
	echo "# DO NOT EDIT THIS FILE" >dot.cshrc
	./repl csh <cshrc >>dot.cshrc

repl : repl.c 
	rm -f repl
	${CC} -o ../bin/rc.repl repl.c
	ln -s ../bin/rc.repl repl

.done_gen-shell-scripts : dot.cshrc Makefile gen-shell-scripts
	./gen-shell-scripts
	-install openxm ../bin
	touch .done_gen-shell-scripts

#For the backword compatibility.
install: install-trad
install-trad : all-trad  install-man
	-install $(SHELL_SCRIPTS) ${INSTALL_DIR}
install-man :
	-install openxm.1 ${MAN_DIR}
install-kde-menu-knoppix:
	install kde/openxm-binary-knoppix ${KDE_MENU_DIR}/openxm-binary

clean :
	rm -rf dot.bashrc dot.cshrc repl openxm $(SHELL_SCRIPTS) .done_gen-shell-scripts work global .done_global

## New targets.  Relocate OpenXM under ${prefix}
## They are designed to be a top level Makefile
all:
	(cd ../src ; make all)
all-non-free:
	(cd ../src ; make all-asir2000)
all-global-shell-scripts: repl
	@if [ ! -f .done_global ] ; then \
	echo "Generating shell scripts in global" ; \
	rm -rf global ; mkdir global ; \
	(cd global ; ../repl bash --prefix ${prefix} <../bashrc >dot.bashrc); \
	(cd global ; ../repl csh --prefix ${prefix} <../cshrc >dot.cshrc); \
	(cd global ; ../gen-shell-scripts) ; \
	touch .done_global ; \
	fi
install-under-prefix: all-global-shell-scripts  
	(cd ../src ; make install)
	make copy-free
	make copy-non-free

clean-under-prefix:
	-(cd ${prefix} ; rm -rf ${prefix}/OpenXM )

# junk-list is not a collection of real junk files. 
# Files in it are not necessary for the binary package. They are important.
copy-free: all-global-shell-scripts
	-mkdir ${prefix}
	-(cd ../.. ; tar czf - --exclude-from OpenXM/rc/non-free-list --exclude OpenXM/misc --exclude OpenXM/rc --exclude OpenXM/src --exclude-from OpenXM/rc/junk-list OpenXM) | (cd ${prefix} ; tar xvzf -)
# During installation OpenXM/bin/openxm must be overridden by global/openxm
	install global/openxm ${prefix}/OpenXM/bin

copy-non-free:
	-mkdir ${prefix}
	-(cd ../.. ; tar czf - --exclude-from OpenXM/rc/junk-list `cat OpenXM/rc/non-free-list`) | (cd ${prefix} ; tar xvzf -)