Annotation of OpenXM/src/kan96xx/Kan/Makefile, Revision 1.11
1.11 ! takayama 1: ### $OpenXM: OpenXM/src/kan96xx/Kan/Makefile,v 1.10 2000/09/17 03:12:11 takayama Exp $
1.1 maekawa 2: all : sm1
1.5 takayama 3: # .SUFFIXES:
1.1 maekawa 4: ########################## configuration ##############################
1.11 ! takayama 5: TOPDIR=../../../../OpenXM
! 6: OpenXM_HOME=${TOPDIR}
1.10 takayama 7: OpenXM_include=$(OpenXM_HOME)/include
1.1 maekawa 8: #### What C compiler do you use?
9: CC = gcc
10: #### Gargabe collector? If GC = nogc.c, then you need to define -DNOGC.
1.11 ! takayama 11: GC = $(OpenXM_HOME)/lib/libgc.a
1.1 maekawa 12: #GC = nogc.c
13: #### -D options
1.6 takayama 14: DDD = -D_BSD_SOURCE
15: #DDD = -DNOGC -D_BSD_SOURCE
1.9 takayama 16: #STATIC_LINK_FLAG = -static
17: STATIC_LINK_FLAG =
1.1 maekawa 18:
19: #### Optimization level etc.
20: #CFLAGS =
21: #### option for dbx
22: CFLAGS = -O
23: #### optimizer which seems not to be reliable at level 2,3 and 4.
24: #CFLAGS = -O
25: #### profiler to output mon.out
26: #CFLAGS = -O
27:
28: GMP_HOME2 = ../../gmp
1.10 takayama 29: LIBGMP = $(OpenXM_HOME)/lib/libgmp.so -Wl,--rpath -Wl,$(OpenXM_HOME)/lib
1.1 maekawa 30: ## This line is for buggy linux-gmp.
31: ##LIBGMP = $(GMP_HOME)/libgmp.a $(GMP_HOME)/mpn/libmpn.a
32:
1.2 takayama 33: ## Library you need on Solaris 2.*
34: SOLARISLIB = -lnsl -lsocket /usr/ucblib/libucb.a
1.1 maekawa 35:
36: ################### Plugin modules
37: ## Note that you need to make PLUGIN_LIB by your hand.
38: ## Example:
39: ## (1)
40: ##PLUGIN = ../plugin
41: ##PLUGIN_PROTOTYPE = $(PLUGIN)/sample.h $(PLUGIN)/graphic0.h
42: ##PLUGIN_LIB = $(PLUGIN)/sample.a $(PLUGIN)/graphic0.a
43: ##PLUGIN_EXT = $(PLUGIN)/sample.hh $(PLUGIN)/graphic0.hh
44: ##PLUGIN_SM1 =$(PLUGIN)/sample.sm1 $(PLUGIN)/graphic0.sm1
45: ##PLUGIN_LINKFLAG = -lx11
46: ###### end of example. If you do not use plugins, remove the following lines
47: ###### which starting with PLUGIN*
48: #### (2) cmo, file2, socket
49: #### Note : if you change below, make the same changes at AAA.
50: PLUGIN = ../plugin
51: PLUGIN_PROTOTYPE = $(PLUGIN)/mathcap.h $(PLUGIN)/file2.h $(PLUGIN)/sm1Socket.h $(PLUGIN)/cmo.h $(PLUGIN)/ox.h
52: PLUGIN_LIB = $(PLUGIN)/sm1Socket.a $(PLUGIN)/cmo.a $(PLUGIN)/file2.a $(PLUGIN)/ox.a
53: PLUGIN_EXT = $(PLUGIN)/file2.hh $(PLUGIN)/sm1Socket.hh $(PLUGIN)/cmo.hh $(PLUGIN)/ox.hh
54: PLUGIN_SM1 = $(PLUGIN)/sm1Socket.sm1 $(PLUGIN)/file2.sm1 $(PLUGIN)/cmo.sm1 $(PLUGIN)/oxx.sm1
55: PLUGIN_LINKFLAG =
56: #### AAA (2) cmo, file2, socket
57: #PLUGIN = ../plugin
58: #PLUGIN_PROTOTYPE = $(PLUGIN)/mathcap.h $(PLUGIN)/file2.h $(PLUGIN)/sm1Socket.h $(PLUGIN)/cmo.h $(PLUGIN)/ox.h
59: #PLUGIN_LIB = $(PLUGIN)/sm1Socket.a $(PLUGIN)/cmo.a $(PLUGIN)/file2.a $(PLUGIN)/ox.a
60: #PLUGIN_EXT = $(PLUGIN)/file2.hh $(PLUGIN)/sm1Socket.hh $(PLUGIN)/cmo.hh $(PLUGIN)/ox.hh
61: #PLUGIN_SM1 = $(PLUGIN)/sm1Socket.sm1 $(PLUGIN)/file2.sm1 $(PLUGIN)/cmo.sm1 $(PLUGIN)/oxx.sm1
62: #PLUGIN_LINKFLAG =
63: #### (3) cmo only
64: #PLUGIN = ../plugin
65: #PLUGIN_PROTOTYPE = $(PLUGIN)/mathcap.h $(PLUGIN)/cmo.h
66: #PLUGIN_LIB = $(PLUGIN)/cmo.a
67: #PLUGIN_EXT = $(PLUGIN)/cmo.hh
68: #PLUGIN_SM1 =
69: #PLUGIN_LINKFLAG =
70: ### (4) sm1 with asir, file2, socket cmo.
71: ### You also need the special GC for asir.
72: #PLUGIN = ../plugin
73: #PLUGIN_PROTOTYPE = $(PLUGIN)/mathcap.h $(PLUGIN)/file2.h $(PLUGIN)/sample.h $(PLUGIN)/sm1Socket.h $(PLUGIN)/asir.h $(PLUGIN)/cmo.h
74: #PLUGIN_LIB = $(PLUGIN)/file2.a $(PLUGIN)/sample.a $(PLUGIN)/sm1Socket.a $(PLUGIN)/libasir.a $(PLUGIN)/asirconv.a $(PLUGIN)/ak.a $(PLUGIN)/cmo.a
75: #PLUGIN_EXT = $(PLUGIN)/file2.hh $(PLUGIN)/sample.hh $(PLUGIN)/sm1Socket.hh $(PLUGIN)/asir.hh $(PLUGIN)/cmo.hh
76: #PLUGIN_SM1 = $(PLUGIN)/file2.sm1 $(PLUGIN)/sample.sm1 $(PLUGIN)/sm1Socket.sm1
77: #PLUGIN_LINKFLAG = -lpari -lXaw -lXmu -L/usr/X11R6/lib -lXt -lX11 -lXt -lSM -lICE -lXext -lX11 -lm
78: ############################ end of configuration ########################
79:
80: #HEADERS = datatype.h stackm.h lookup.h extern.h kclass.h Makefile
81: HEADERS = datatype.h stackm.h lookup.h extern.h kclass.h
82: .c.o :
1.10 takayama 83: $(CC) -I$(OpenXM_include) $(CFLAGS) $(DDD) -c $<
1.1 maekawa 84:
85: kanlibP = kanExport0.o kanExport1.o
86: kanlibS1 = stackmachine.o
87: kanlibS2 = scanner.o scanner2.o list.o global.o kclass.o
88: kanlibS3 = usage.o option.o
89: kanlibS4 = primitive.o
90: kanlibK = matrix.o poly4.o replace.o poly3.o poly.o output.o coeff.o order.o switch.o poly2.o parser.o parserpass0.o rat.o ext.o
91: kanlibK2 = gradedset.o red.o gb.o gbGM.o syz0.o redm.o sugar.o resol.o hilbert.o
92: kanlibKclass = Kclass/sample.o Kclass/rawcmo.o Kclass/indeterminate.o
93:
94: ##### Add also to Kclass/Makefile
95: Kclass/sample.o : $(HEADERS) Kclass/sample.c
96: (cd Kclass ; make CC=$(CC) GMP_HOME2=$(GMP_HOME2) CFLAGS=$(CFLAGS) DDD=$(DDD) sample.o )
97: Kclass/rawcmo.o : $(HEADERS) Kclass/rawcmo.c
98: (cd Kclass ; make CC=$(CC) GMP_HOME2=$(GMP_HOME2) CFLAGS=$(CFLAGS) DDD=$(DDD) rawcmo.o )
99: Kclass/indeterminate.o : $(HEADERS) Kclass/indeterminate.c
100: (cd Kclass ; make CC=$(CC) GMP_HOME2=$(GMP_HOME2) CFLAGS=$(CFLAGS) DDD=$(DDD) indeterminate.o )
101:
102:
103: ######
104: redm.o : extern2.h gradedset.h $(HEADERS)
105: sugar.o : extern2.h gradedset.h $(HEADERS)
106: syz0.o : extern2.h gradedset.h $(HEADERS)
107: resol.o : extern2.h gradedset.h $(HEADERS)
108: hilbert.o : extern2.h gradedset.h $(HEADERS)
109: gbGM.o : extern2.h gradedset.h $(HEADERS)
110: gb.o : extern2.h gradedset.h $(HEADERS)
111: red.o : extern2.h gradedset.h $(HEADERS)
112: gradedset.o : extern2.h gradedset.h $(HEADERS)
113:
114: ########
115: matrix.o : extern2.h matrix.h $(HEADERS)
116: poly4.o : extern2.h matrix.h $(HEADERS)
117: replace3.o : extern2.h $(HEADERS)
118: poly3.o : extern2.h $(HEADERS)
119: parserpass0.o : extern2.h $(HEADERS)
120: parser.o : extern2.h $(HEADERS)
121: poly2.o : extern2.h $(HEADERS)
122: switch.o : extern2.h $(HEADERS) gradedset.h
123: order.o : extern2.h $(HEADERS)
124: coeff.o : extern2.h $(HEADERS)
125: output.o : extern2.h $(HEADERS)
126: poly.o : extern2.h $(HEADERS)
127: rat.o : extern2.h $(HEADERS)
128: ext.o : extern2.h $(HEADERS) plugin.h plugin.hh
129:
130: MSG0 = msg0.o
131:
1.11 ! takayama 132: sm1 : sm.c $(kanlibS1) $(kanlibS2) $(kanlibS3) $(kanlibS4) $(kanlibP) $(kanlibK) $(kanlibK2) $(kanlibKclass) $(PLUGIN_LIB) ${GC}
1.2 takayama 133: if test `uname` = "SunOS" ; \
134: then \
1.11 ! takayama 135: $(CC) -I$(OpenXM_include) $(CFLAGS) $(DDD) -o sm1 sm.c $(kanlibS1) $(kanlibS2) $(kanlibS3) $(kanlibS4) $(kanlibP) $(kanlibK) $(kanlibK2) $(kanlibKclass) $(PLUGIN_LIB) $(LIBGMP) ${GC} $(PLUGIN_LINKFLAG) $(SOLARISLIB) ; \
1.2 takayama 136: else \
1.11 ! takayama 137: $(CC) ${STATIC_LINK_FLAG} -I$(OpenXM_include) $(CFLAGS) $(DDD) -o sm1 sm.c $(kanlibS1) $(kanlibS2) $(kanlibS3) $(kanlibS4) $(kanlibP) $(kanlibK) $(kanlibK2) $(kanlibKclass) $(PLUGIN_LIB) $(LIBGMP) ${GC} $(PLUGIN_LINKFLAG) ; \
1.2 takayama 138: fi
139:
1.1 maekawa 140:
141: $(kanlibP) : $(HEADERS) gradedset.h extern2.h
142: $(kanlibS1) : $(HEADERS) smacro.h gradedset.h
143: $(kanlibS2) : $(HEADERS) gradedset.h extern2.h
144: $(kanlibS3) : $(HEADERS) gradedset.h extern2.h
145: $(kanlibS4) : $(HEADERS) gradedset.h
146:
147:
148: kanlib.a : $(kanlibS1) $(kanlibS2) $(kanlibS3) $(kanlibS4) $(kanlibP) $(kanlibK) $(kanlibK2) $(kanlibKclass) $(PLUGIN_LIB) kanlib.o
149: (cd plugin-tmp; /bin/rm -f *.o; ../ar-decomp $(PLUGIN_LIB) ; cp ../kanlib.o .)
150: ar ru kanlib.a $(kanlibS1) $(kanlibS2) $(kanlibS3) $(kanlibS4) $(kanlibP) $(kanlibK) $(kanlibK2) $(kanlibKclass) plugin-tmp/*.o
151: ../gc/if_not_there ../gc/on_sparc_sunos5 ranlib kanlib.a
152:
153: ##sm1 : sm.c kanlib.a $(GC)
1.10 takayama 154: ## $(CC) -I$(OpenXM_include) $(CFLAGS) $(DDD) -o sm1 sm.c kanlib.a $(LIBGMP) $(GC) $(SOLARISLIB) $(PLUGIN_LINKFLAG)
1.1 maekawa 155:
156:
157: ############ smacro.h and lookup.h
158: smacro.h : smacro.sm1 dr.sm1 module1.sm1 sugar.sm1 usage.sm1 mm $(PLUGIN_SM1)
159: touch smacro.h
160: /bin/rm smacro.h
161: cat smacro.sm1 dr.sm1 module1.sm1 sugar.sm1 usage.sm1 $(PLUGIN_SM1) | ./mm >smacro.h
162:
163: lookup.h : stackm.h mklookup
164: touch lookup.h
165: /bin/rm lookup.h
166: ./mklookup >lookup.h
167:
168: mm : mm.c
169: $(CC) -o mm mm.c
170: mklookup : mklookup.c
1.10 takayama 171: $(CC) -I$(OpenXM_include) -o mklookup mklookup.c
1.1 maekawa 172:
173: ############# sm1 stack machine without algebraic part.
1.11 ! takayama 174: sm00 : sm.c $(kanlibS1) $(kanlibS2) $(kanlibP) $(PLUGIN_LIB) ${GC}
! 175: $(CC) -I$(OpenXM_include) $(CFLAGS) $(DDD) -o sm00 sm.c $(kanlibS1) $(kanlibS2) $(PLUGIN_LIB) $(LIBGMP) ${GC} $(PLUGIN_LINKFLAG) $(SOLARISLIB)
1.1 maekawa 176:
177: ############### plugins
178: plugin.hh : Makefile $(PLUGIN_EXT)
179: rm -f plugin.hh
180: echo '/* Do not edit this file. */' > plugin.hh
181: ./cat0 $(PLUGIN_EXT) >>plugin.hh
182:
183: plugin.h : Makefile $(PLUGIN_PROTOTYPE)
184: rm -f plugin.h
185: echo '/* Do not edit this file. */' > plugin.h
186: ./cat0 $(PLUGIN_PROTOTYPE) >>plugin.h
187:
188: plugin.sm1 : Makefile $(PLUGIN_SM1)
189: rm -f plugin.sm1
190: echo '%% Do not edit this file.' > plugin.sm1
191:
192: install-lib: kanlib.a
193: cp ../plugin/kancmo.h /usr/src/local/yama
194: cp kanlib.a /usr/src/local/yama/kanlib.a
195:
196:
197: clean :
198: rm -f mklookup mm core sm1 lookup.h smacro.h *.o *~ *.a mon.out sm1.nogc kanlib.a plugin.h plugin.hh plugin-tmp/*.o Kclass/*.o Kclass/*~
199:
200: cleana :
201: rm -f mklookup mm core sm1 lookup.h smacro.h *.o *~ *.a mon.out sm1.nogc kanlib.a plugin.h plugin.hh plugin-tmp/*.o Kclass/*.o Kclass/*~
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>