version 1.2, 1999/11/11 12:36:06 |
version 1.17, 2000/12/10 03:12:19 |
|
|
# $OpenXM$ |
# $OpenXM: OpenXM/src/k097/Makefile,v 1.16 2000/12/10 02:25:31 takayama Exp $ |
|
# targets |
|
# all |
|
# compile |
|
# intall : all install-lib |
|
# |
|
# install-for-debug |
|
# |
|
OpenXM_HOME=../../../OpenXM |
|
OpenXM_include=$(OpenXM_HOME)/include |
BDATE =19970416 |
BDATE =19970416 |
CC = gcc |
CC = gcc |
GC = $(KHOME)/gc/gc.a |
GC = $(KHOME)/gc/gc.a |
|
OpenXM_lib=../../lib |
|
DDD=-D_BSD_SOURCE |
|
#STATIC_LINK_FLAG=-static |
|
STATIC_LINK_FLAG= |
|
|
## Kan source. kan sources must be built up by hand. |
## Kan source. kan sources must be built up by hand. |
KHOME = ../SSkan |
KHOME = ../kan96xx |
|
|
|
|
## |
## |
LOAD_K_PATH ='"/usr/local/lib/k0/"' |
LOAD_K_PATH ='"/usr/local/lib/k0/"' |
LOAD_SM1_PATH2 ='"/home/nobuki/SSkan/Kan/"' |
LOAD_SM1_PATH2 ='"/this_directory_does_not_exists/"' |
## |
## |
GMP_HOME = $(KHOME)/gmp |
LIBGMP=$(OpenXM_HOME)/lib/libgmp.a |
##LIBGMP=$(GMP_HOME)/libgmp.a |
|
## 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. |
|
|
|
|
sed -f new.sed <Makefile >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 |
$(CC) $(FLAG) -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 |
|
|
d.o : d.c simple.tab.h Stable/sm1symbol.h |
d.o : d.c simple.tab.h Stable/sm1symbol.h |
$(CC) $(FLAG) -o d.o -c d.c |
$(CC) $(FLAG) $(DDD) -o d.o -c d.c |
|
|
simple.tab.o : simple.tab.c |
simple.tab.o : simple.tab.c |
$(CC) $(FLAG) -o simple.tab.o -c simple.tab.c |
$(CC) $(FLAG) $(DDD) -o simple.tab.o -c simple.tab.c |
|
|
simple.tab.c : simple.y d.h |
simple.tab.c : simple.y d.h |
$(MYYACC) $(YACCPREFIX) simple.y |
$(MYYACC) $(YACCPREFIX) simple.y |
|
|
/bin/rm slib.sm1 |
/bin/rm slib.sm1 |
./d0 -DebugMode <slib.k >slib.sm1 |
./d0 -DebugMode <slib.k >slib.sm1 |
|
|
|
slib.sm1 : slib.k |
|
make slib |
|
|
#################################################################### |
#################################################################### |
############# 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 |
KXXASIR = simple.tab.o d.o ki-asir.o dic.o |
|
|
k0 : k0.o $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(GMP) $(KAN_HOME)/lookup.h |
k0 : k0.o $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(LIBGMP) $(KAN_HOME)/lookup.h |
if test `uname` = "SunOS" ; \ |
if test `uname` = "SunOS" ; \ |
then \ |
then \ |
$(CC) $(FLAG) -I$(GMP_HOME) -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) ; \ |
else \ |
else \ |
$(CC) $(FLAG) -I$(GMP_HOME) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) ; \ |
$(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) ; \ |
fi |
fi |
|
|
k0.o : k2.c |
k0.o : k2.c |
$(CC) -c $(FLAG) -I$(GMP_HOME) -I$(KAN_HOME) -o k0.o k2.c |
$(CC) -c $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0.o k2.c |
|
|
ki.o : ki.c |
ki.o : ki.c |
$(CC) -c $(FLAG) -I$(GMP_HOME) -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 |
ki-asir.o : ki.c |
$(CC) -c $(FLAG) -DCALLASIR -I$(GMP_HOME) -I$(KAN_HOME) -o 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) -o dic.o dic.c |
$(CC) -c $(FLAG) $(DDD) -o dic.o dic.c |
|
|
$(KAN_HOME)/kanlib.a : $(KAN_HOME)/sm1 |
$(KAN_HOME)/kanlib.a : $(KAN_HOME)/sm1 |
(cd $(KAN_HOME); make kanlib.a) |
(cd $(KAN_HOME); make kanlib.a) |
|
|
ASIRKAN = $(ASIRKAN_HOME)/ak.a |
ASIRKAN = $(ASIRKAN_HOME)/ak.a |
K2INCLUDE = -I$(ASIR_INCLUDE) -I$(ASIR_INCLUDE2) -I$(KHOME)/Kan -I$(ASIRKAN_HOME) $(SOLARIS_EXTRA_INCLUDE) |
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) $(GMP) |
k2 : k2.c $(KAN_HOME)/kanlib.a $(KXXASIR) msg1.o $(ASIRKAN) $(ASIRKAN_HOME)/$(CALL_ASIR) $(ASIRGC) |
$(CC) $(FLAG) -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) $(GMP) $(ASIRGC) |
$(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) |
|
|
msg1.o : msg1.c |
msg1.o : msg1.c |
$(CC) $(FLAG) -DCALLASIR $(K2INCLUDE) -c msg1.c |
$(CC) $(FLAG) $(DDD) -DCALLASIR $(K2INCLUDE) -c msg1.c |
|
|
|
|
$(ASIRKAN) : |
$(ASIRKAN) : |
(cd $(ASIRKAN_HOME); make ak.a) |
(cd $(ASIRKAN_HOME); make ak.a) |
|
|
|
|
$(GMP) : |
|
(cd $(KHOME)/gmp ; ./configure; make ) |
|
$(GC) : |
$(GC) : |
(cd $(KHOME)/gc ; make ) |
(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) $(GMP) $(KAN_HOME)/lookup.h |
test0 : test0.c $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(KAN_HOME)/lookup.h |
$(CC) $(FLAG) -I$(GMP_HOME) -I$(KAN_HOME) -o test0 test0.c $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) |
$(CC) $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o test0 test0.c $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) |
|
|
|
|
|
|
install : all |
install0 : all |
cp --f k0 d0 $(HOME)/.Hbin |
cp -f k0 d0 $(HOME)/.Hbin |
cp lib/mklib $(HOME)/.Hbin |
cp lib/mklib $(HOME)/.Hbin |
echo "Set the environment variable in $(HOME)/bin/mklib" |
echo "Set the environment variable in $(HOME)/bin/mklib" |
|
|
|
install : all install-lib |
|
cp -f k0 d0 ../../bin |
|
|
|
install-for-debug : all install-lib-for-debug |
|
rm -f ../../bin/k0 ../../bin/d0 |
|
(cd ../../bin ; ln -s ../src/k097/k0 k0) |
|
(cd ../../bin ; ln -s ../src/k097/d0 d0) |
|
|
|
install-lib : |
|
/bin/rm -rf $(OpenXM_lib)/k097 |
|
mkdir $(OpenXM_lib)/k097 |
|
cp -f $(KHOME)/Doc/var.sm1 $(OpenXM_lib)/k097 |
|
cp -rf *.sm1 *.k *.kk debug lib $(OpenXM_lib)/k097 |
|
|
|
install-lib-for-debug : |
|
/bin/rm -rf $(OpenXM_lib)/k097 |
|
ln -s ../src/k097 $(OpenXM_lib)/k097 |
|
|
dist : |
dist : |
./makeDist |
./makeDist |