Annotation of OpenXM/src/k097/Makefile, Revision 1.15
1.15 ! takayama 1: # $OpenXM: OpenXM/src/k097/Makefile,v 1.14 2000/05/24 15:24:53 takayama Exp $
1.7 takayama 2: # targets
3: # all
4: # compile
1.8 takayama 5: # intall : all install-lib
1.7 takayama 6: #
1.14 takayama 7: # install-for-debug
1.7 takayama 8: #
1.15 ! takayama 9: OpenXM_HOME=../../../OpenXM
! 10: OpenXM_include=$(OpenXM_HOME)/include
1.1 maekawa 11: BDATE =19970416
12: CC = gcc
13: GC = $(KHOME)/gc/gc.a
1.8 takayama 14: OpenXM_lib=../../lib
1.9 takayama 15: DDD=-D_BSD_SOURCE
1.12 takayama 16: #STATIC_LINK_FLAG=-static
17: STATIC_LINK_FLAG=
1.1 maekawa 18:
19: ## Kan source. kan sources must be built up by hand.
1.6 takayama 20: KHOME = ../kan96xx
1.1 maekawa 21:
22:
23: ##
24: LOAD_K_PATH ='"/usr/local/lib/k0/"'
1.13 takayama 25: LOAD_SM1_PATH2 ='"/this_directory_does_not_exists/"'
1.1 maekawa 26: ##
1.15 ! takayama 27: LIBGMP=$(OpenXM_HOME)/lib/libgmp.a
1.1 maekawa 28: ## This line is for buggy linux-gmp.
1.4 takayama 29: ## LIBGMP = $(GMP_HOME)/libgmp.a $(GMP_HOME)/mpn/libmpn.a
1.1 maekawa 30: EXTRALIB =
31: ########### end of configuration.
32:
33: ### These are to switch k2 linux and k2 solaris version.
1.2 takayama 34: SOLARIS_SLIB = -lsocket -lnsl -lc /usr/ucblib/libucb.a
1.1 maekawa 35: ### if you use K2LFLAG below, you don't need ALIB.
36: #K2LFLAG = -lm $(SOLARIS_ALIB)
37: K2LFLAG = -lfunc -lparse -lengine -lm -Wl,-rpath,/usr/X11R6/lib
38: #CALL_ASIR=callasir.solaris.c
39: CALL_ASIR=callasir.c
40: PARI_LIB = -lpari
41: ###########################################################
42: 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)
43: SOLARIS_EXTRA_INCLUDE = -I$(AHOME)/parse -I$(AHOME)/io
44: ###########################################################
45:
46: CC = gcc
47: MYYACC = bison
48: YACCPREFIX = -p KC
49: FLAG = -g -DLOAD_K_PATH=$(LOAD_K_PATH) -DLOAD_SM1_PATH2=$(LOAD_SM1_PATH2)
50: KAN_HOME = $(KHOME)/Kan
51:
52: all : d0 k0
53:
54: ## Making a new Makefile
55: new :
56: touch Makefile.new
57: /bin/cp Makefile.new Trash
58: /bin/rm -f Makefile.new
59: sed -f new.sed <Makefile >Makefile.new
60:
61: d0 : simple.tab.o d.o dic.o dm.c
1.11 takayama 62: $(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -o d0 dm.c d.o dic.o simple.tab.o
1.1 maekawa 63:
64: d.o : d.c simple.tab.h Stable/sm1symbol.h
1.9 takayama 65: $(CC) $(FLAG) $(DDD) -o d.o -c d.c
1.1 maekawa 66:
67: simple.tab.o : simple.tab.c
1.9 takayama 68: $(CC) $(FLAG) $(DDD) -o simple.tab.o -c simple.tab.c
1.1 maekawa 69:
70: simple.tab.c : simple.y d.h
71: $(MYYACC) $(YACCPREFIX) simple.y
72:
73: simple.tab.h : simple.y d.h
74: $(MYYACC) $(YACCPREFIX) -d simple.y
75:
76: Stable/sm1symbo.h : Stable/reserved.txt
77: (cd Stable; make)
78:
79: clean :
80: rm -f simple d0 k0 test0 *.o *~ simple.output asir-tmp.t asir-tmp.tt asir-tmp-out.t asir-tmp-out.tt k2
81: (cd Stable; make clean)
82: (cd try; make clean)
83: ## rm -f simple.tab.c simple.tab.h
84:
85: backup :
86: cp simple.y d.c dm.c k2.c ki.c msg*.c d.h Makefile *.k incmac.sm1 memo.txt Backup/backup$(BDATE)
87:
88: test: d0
89: touch t.sm1
90: /bin/rm t.sm1
91: ./d0 <test.ccc >t.sm1
92:
93: slib: d0
94: touch slib.sm1
95: /bin/rm slib.sm1
96: ./d0 -DebugMode <slib.k >slib.sm1
97:
98: ####################################################################
99: ############# kxx main parts.
100: ###################################################################
101: KXX = simple.tab.o d.o ki.o dic.o
102: KXXASIR = simple.tab.o d.o ki-asir.o dic.o
103:
1.15 ! takayama 104: k0 : k0.o $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(LIBGMP) $(KAN_HOME)/lookup.h
1.2 takayama 105: if test `uname` = "SunOS" ; \
106: then \
1.15 ! takayama 107: $(CC) $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) $(SOLARIS_SLIB) ; \
1.2 takayama 108: else \
1.15 ! takayama 109: $(CC) ${STATIC_LINK_FLAG} $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0 k0.o $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC) $(EXTRALIB) ; \
1.2 takayama 110: fi
1.1 maekawa 111:
112: k0.o : k2.c
1.15 ! takayama 113: $(CC) -c $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o k0.o k2.c
1.1 maekawa 114:
115: ki.o : ki.c
1.15 ! takayama 116: $(CC) -c $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o ki.o ki.c
1.1 maekawa 117:
118: ki-asir.o : ki.c
1.15 ! takayama 119: $(CC) -c $(FLAG) $(DDD) -DCALLASIR -I$(OpenXM_include) -I$(KAN_HOME) -o ki-asir.o ki.c
1.1 maekawa 120:
121: dic.o : dic.c d.h
1.9 takayama 122: $(CC) -c $(FLAG) $(DDD) -o dic.o dic.c
1.1 maekawa 123:
124: $(KAN_HOME)/kanlib.a : $(KAN_HOME)/sm1
125: (cd $(KAN_HOME); make kanlib.a)
126:
127: kanlib.a :
128: (cd $(KAN_HOME); make kanlib.a)
129:
130: $(KAN_HOME)/lookup.h :
131: (cd $(KAN_HOME); make lookup.h)
132:
133: ######## How to make k2. k2 is k0&asir&sm1
134: ## asir GC.
135: ASIRGC = $(AHOME)/gc/libgc.a
136: ## asir include
137: ASIR_INCLUDE = $(AHOME)/include
138: ASIR_INCLUDE2 = $(ALIB)/include
139: LFLAG = $(K2LFLAG)
140: GMP = $(LIBGMP)
141: ASIRKAN = $(ASIRKAN_HOME)/ak.a
142: K2INCLUDE = -I$(ASIR_INCLUDE) -I$(ASIR_INCLUDE2) -I$(KHOME)/Kan -I$(ASIRKAN_HOME) $(SOLARIS_EXTRA_INCLUDE)
143:
1.15 ! takayama 144: k2 : k2.c $(KAN_HOME)/kanlib.a $(KXXASIR) msg1.o $(ASIRKAN) $(ASIRKAN_HOME)/$(CALL_ASIR) $(ASIRGC)
! 145: $(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)
1.1 maekawa 146:
147: msg1.o : msg1.c
1.9 takayama 148: $(CC) $(FLAG) $(DDD) -DCALLASIR $(K2INCLUDE) -c msg1.c
1.1 maekawa 149:
150:
151: $(ASIRKAN) :
152: (cd $(ASIRKAN_HOME); make ak.a)
153:
154:
155: $(GC) :
156: (cd $(KHOME)/gc ; make )
157:
158:
159: ##########
160: ## A sample to compilation: source is test0.c, output is test0
1.15 ! takayama 161: test0 : test0.c $(KXX) $(KAN_HOME)/kanlib.a $(GC) $(KAN_HOME)/lookup.h
! 162: $(CC) $(FLAG) $(DDD) -I$(OpenXM_include) -I$(KAN_HOME) -o test0 test0.c $(KXX) $(KAN_HOME)/kanlib.a $(LIBGMP) $(GC)
1.1 maekawa 163:
164:
165:
1.3 takayama 166: install0 : all
1.5 takayama 167: cp -f k0 d0 $(HOME)/.Hbin
1.1 maekawa 168: cp lib/mklib $(HOME)/.Hbin
169: echo "Set the environment variable in $(HOME)/bin/mklib"
1.3 takayama 170:
1.8 takayama 171: install : all install-lib
1.5 takayama 172: cp -f k0 d0 ../../bin
1.8 takayama 173:
1.14 takayama 174: install-for-debug : all install-lib-for-debug
175: rm -f ../../bin/k0 ../../bin/d0
176: (cd ../../bin ; ln -s ../src/k097/k0 k0)
177: (cd ../../bin ; ln -s ../src/k097/d0 d0)
178:
1.8 takayama 179: install-lib :
180: /bin/rm -rf $(OpenXM_lib)/k097
181: mkdir $(OpenXM_lib)/k097
182: cp -f $(KHOME)/Doc/var.sm1 $(OpenXM_lib)/k097
183: cp -rf *.sm1 *.k *.kk debug $(OpenXM_lib)/k097
184:
1.14 takayama 185: install-lib-for-debug :
1.8 takayama 186: /bin/rm -rf $(OpenXM_lib)/k097
187: ln -s ../src/k097 $(OpenXM_lib)/k097
1.1 maekawa 188:
189: dist :
190: ./makeDist
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>