version 1.16, 2000/12/10 02:25:31 |
version 1.26, 2003/07/21 13:36:40 |
|
|
# $OpenXM: OpenXM/src/k097/Makefile,v 1.15 2000/09/17 03:12:10 takayama Exp $ |
# $OpenXM: OpenXM/src/k097/Makefile,v 1.25 2003/07/21 12:41:22 takayama Exp $ |
# targets |
# targets |
# all |
# all |
# compile |
# compile |
|
|
# |
# |
# install-for-debug |
# install-for-debug |
# |
# |
OpenXM_HOME=../../../OpenXM |
TOPDIR=../../../OpenXM |
|
OpenXM_HOME=${TOPDIR} |
OpenXM_include=$(OpenXM_HOME)/include |
OpenXM_include=$(OpenXM_HOME)/include |
BDATE =19970416 |
|
CC = gcc |
|
GC = $(KHOME)/gc/gc.a |
|
OpenXM_lib=../../lib |
OpenXM_lib=../../lib |
|
CC = gcc |
|
BDATE =19970416 |
|
GC = $(OpenXM_HOME)/lib/libgc.a |
DDD=-D_BSD_SOURCE |
DDD=-D_BSD_SOURCE |
#STATIC_LINK_FLAG=-static |
#STATIC_LINK_FLAG=-static |
STATIC_LINK_FLAG= |
STATIC_LINK_FLAG= |
|
|
## Kan source. kan sources must be built up by hand. |
## Kan source. kan sources must be built up by hand. |
KHOME = ../kan96xx |
KHOME = $(OpenXM_HOME)/src/kan96xx |
|
|
|
|
## |
## |
LOAD_K_PATH ='"/usr/local/lib/k0/"' |
LOAD_K_PATH ='"/usr/local/lib/k0/"' |
LOAD_SM1_PATH2 ='"/this_directory_does_not_exists/"' |
LOAD_SM1_PATH2 ='"/this_directory_does_not_exists/"' |
## |
## |
LIBGMP=$(OpenXM_HOME)/lib/libgmp.a |
LIBGMP=-L$(OpenXM_HOME)/lib -lgmp |
## This line is for buggy linux-gmp. |
## This line is for buggy linux-gmp. |
## LIBGMP = $(GMP_HOME)/libgmp.a $(GMP_HOME)/mpn/libmpn.a |
## LIBGMP = $(GMP_HOME)/libgmp.a $(GMP_HOME)/mpn/libmpn.a |
EXTRALIB = |
EXTRALIB = |
########### end of configuration. |
########### end of configuration. |
|
|
### These are to switch k2 linux and k2 solaris version. |
|
SOLARIS_SLIB = -lsocket -lnsl -lc /usr/ucblib/libucb.a |
SOLARIS_SLIB = -lsocket -lnsl -lc /usr/ucblib/libucb.a |
### if you use K2LFLAG below, you don't need ALIB. |
|
#K2LFLAG = -lm $(SOLARIS_ALIB) |
|
K2LFLAG = -lfunc -lparse -lengine -lm -Wl,-rpath,/usr/X11R6/lib |
|
#CALL_ASIR=callasir.solaris.c |
|
CALL_ASIR=callasir.c |
|
PARI_LIB = -lpari |
|
########################################################### |
|
SOLARIS_ALIB = -L$(AHOME)/usrlib $(AHOME)/io/tcpf.o $(AHOME)/plot/plotf.o $(AHOME)/builtin/libfunc.a $(AHOME)/parse/libparse.a $(AHOME)/io/libio.a $(AHOME)/engine/libca.a $(AHOME)/asm/libasm.a $(PARI_LIB) $(SOLARIS_SLIB) |
|
SOLARIS_EXTRA_INCLUDE = -I$(AHOME)/parse -I$(AHOME)/io |
|
########################################################### |
|
|
|
CC = gcc |
|
MYYACC = bison |
MYYACC = bison |
YACCPREFIX = -p KC |
YACCPREFIX = -p KC |
FLAG = -g -DLOAD_K_PATH=$(LOAD_K_PATH) -DLOAD_SM1_PATH2=$(LOAD_SM1_PATH2) |
FLAG = -g -DLOAD_K_PATH=$(LOAD_K_PATH) -DLOAD_SM1_PATH2=$(LOAD_SM1_PATH2) |
KAN_HOME = $(KHOME)/Kan |
KAN_HOME = $(KHOME)/Kan |
|
PATHFINDER = -L${OpenXM_lib} -lox_pathfinder |
|
|
all : d0 k0 |
all : d0 k0 ox_k0 |
|
|
## Making a new Makefile |
|
new : |
|
touch Makefile.new |
|
/bin/cp Makefile.new Trash |
|
/bin/rm -f Makefile.new |
|
sed -f new.sed <Makefile >Makefile.new |
|
|
|
d0 : simple.tab.o d.o dic.o dm.c |
d0 : simple.tab.o d.o dic.o dm.c ${OpenXM_lib}/libox_pathfinder.a |
$(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -o d0 dm.c d.o dic.o simple.tab.o |
$(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -o d0 dm.c d.o dic.o simple.tab.o ${PATHFINDER} |
|
|
d.o : d.c simple.tab.h Stable/sm1symbol.h |
d.o : d.c simple.tab.h Stable/sm1symbol.h |
$(CC) $(FLAG) $(DDD) -o d.o -c d.c |
$(CC) -I${OpenXM_include} $(FLAG) $(DDD) -o d.o -c d.c |
|
|
simple.tab.o : simple.tab.c |
simple.tab.o : simple.tab.c |
$(CC) $(FLAG) $(DDD) -o simple.tab.o -c simple.tab.c |
$(CC) $(FLAG) $(DDD) -o simple.tab.o -c simple.tab.c |
|
|
(cd try; make clean) |
(cd try; make clean) |
## rm -f simple.tab.c simple.tab.h |
## rm -f simple.tab.c simple.tab.h |
|
|
backup : |
|
cp simple.y d.c dm.c k2.c ki.c msg*.c d.h Makefile *.k incmac.sm1 memo.txt Backup/backup$(BDATE) |
|
|
|
test: d0 |
test: d0 |
touch t.sm1 |
touch t.sm1 |
/bin/rm t.sm1 |
/bin/rm t.sm1 |
Line 102 slib.sm1 : slib.k |
|
Line 81 slib.sm1 : slib.k |
|
############# kxx main parts. |
############# kxx main parts. |
################################################################### |
################################################################### |
KXX = simple.tab.o d.o ki.o dic.o |
KXX = simple.tab.o d.o ki.o dic.o |
KXXASIR = simple.tab.o d.o ki-asir.o dic.o |
|
|
|
k0 : k0.o $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(LIBGMP) $(KAN_HOME)/lookup.h |
k0 : k0.o $(KXX) $(KAN_HOME)/kanlib.a $(KAN_HOME)/lookup.h |
if test `uname` = "SunOS" ; \ |
if test `uname` = "SunOS" ; \ |
then \ |
then \ |
$(CC) $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) $(SOLARIS_SLIB) ; \ |
$(CC) $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) $(SOLARIS_SLIB) ; \ |
|
|
ki.o : ki.c |
ki.o : ki.c |
$(CC) -c $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o ki.o ki.c |
$(CC) -c $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o ki.o ki.c |
|
|
ki-asir.o : ki.c |
|
$(CC) -c $(FLAG) $(DDD) -DCALLASIR -I$(OpenXM_include) -I$(KAN_HOME) -o ki-asir.o ki.c |
|
|
|
dic.o : dic.c d.h |
dic.o : dic.c d.h |
$(CC) -c $(FLAG) $(DDD) -o dic.o dic.c |
$(CC) -c $(FLAG) $(DDD) -o dic.o dic.c |
|
|
|
|
$(KAN_HOME)/lookup.h : |
$(KAN_HOME)/lookup.h : |
(cd $(KAN_HOME); make lookup.h) |
(cd $(KAN_HOME); make lookup.h) |
|
|
######## How to make k2. k2 is k0&asir&sm1 |
|
## asir GC. |
|
ASIRGC = $(AHOME)/gc/libgc.a |
|
## asir include |
|
ASIR_INCLUDE = $(AHOME)/include |
|
ASIR_INCLUDE2 = $(ALIB)/include |
|
LFLAG = $(K2LFLAG) |
|
GMP = $(LIBGMP) |
|
ASIRKAN = $(ASIRKAN_HOME)/ak.a |
|
K2INCLUDE = -I$(ASIR_INCLUDE) -I$(ASIR_INCLUDE2) -I$(KHOME)/Kan -I$(ASIRKAN_HOME) $(SOLARIS_EXTRA_INCLUDE) |
|
|
|
k2 : k2.c $(KAN_HOME)/kanlib.a $(KXXASIR) msg1.o $(ASIRKAN) $(ASIRKAN_HOME)/$(CALL_ASIR) $(ASIRGC) |
ox_k0 : ox_k0.c k0 ox_k0.c sm1sm.c |
$(CC) $(FLAG) $(DDD) -DCALLASIR $(K2INCLUDE) -o k2 k2.c $(KXXASIR) msg1.o $(ASIRKAN_HOME)/$(CALL_ASIR) -L/usr/X11R6/lib -L$(ALIB) $(LFLAG) $(KAN_HOME)/kanlib.a $(ASIRKAN) $(ASIRGC) |
$(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o ox_k0 ox_k0.c sm1sm.c $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) |
|
|
msg1.o : msg1.c |
|
$(CC) $(FLAG) $(DDD) -DCALLASIR $(K2INCLUDE) -c msg1.c |
|
|
|
|
|
$(ASIRKAN) : |
|
(cd $(ASIRKAN_HOME); make ak.a) |
|
|
|
|
|
$(GC) : |
|
(cd $(KHOME)/gc ; make ) |
|
|
|
|
|
########## |
########## |
## A sample to compilation: source is test0.c, output is test0 |
## A sample to compilation: source is test0.c, output is test0 |
test0 : test0.c $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(KAN_HOME)/lookup.h |
test0 : test0.c $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(KAN_HOME)/lookup.h |
|
|
echo "Set the environment variable in $(HOME)/bin/mklib" |
echo "Set the environment variable in $(HOME)/bin/mklib" |
|
|
install : all install-lib |
install : all install-lib |
|
/bin/rm -f ../../bin/k0 ../../bin/d0 |
cp -f k0 d0 ../../bin |
cp -f k0 d0 ../../bin |
|
cp -f ox_k0 ../../bin |
|
cp -f ox_k0 ../../lib/sm1/bin |
|
|
install-for-debug : all install-lib-for-debug |
install-for-debug : all install-lib-for-debug |
rm -f ../../bin/k0 ../../bin/d0 |
rm -f ../../bin/k0 ../../bin/d0 ../../bin/ox_k0 ../../lib/sm1/bin/ox_k0 |
(cd ../../bin ; ln -s ../src/k097/k0 k0) |
(cd ../../bin ; ln -s ../src/k097/k0 k0) |
(cd ../../bin ; ln -s ../src/k097/d0 d0) |
(cd ../../bin ; ln -s ../src/k097/d0 d0) |
|
(cd ../../bin ; ln -s ../src/k097/ox_k0 ox_k0) |
|
(cd ../../lib/sm1/bin ; ln -s ../../../../src/k097/ox_k0 ox_k0) |
|
|
install-lib : |
install-lib : |
/bin/rm -rf $(OpenXM_lib)/k097 |
/bin/rm -rf $(OpenXM_lib)/k097 |
mkdir $(OpenXM_lib)/k097 |
mkdir $(OpenXM_lib)/k097 |
cp -f $(KHOME)/Doc/var.sm1 $(OpenXM_lib)/k097 |
cp -f $(KHOME)/Doc/var.sm1 $(OpenXM_lib)/k097 |
cp -rf *.sm1 *.k *.kk debug $(OpenXM_lib)/k097 |
cp -rf *.sm1 *.k *.kk debug lib $(OpenXM_lib)/k097 |
|
|
install-lib-for-debug : |
install-lib-for-debug : |
/bin/rm -rf $(OpenXM_lib)/k097 |
/bin/rm -rf $(OpenXM_lib)/k097 |