version 1.2, 1999/10/13 18:45:28
|
version 1.24, 2020/07/08 18:20:11
|
Line 1
|
Line 1
|
# ================================================================== |
# ================================================================== |
# Makefile for CAPA 5.1 |
# Makefile for CAPA 5.1 |
# ================================================================== |
# ================================================================== |
|
# Copyright (C) 1992-2000 Michigan State University |
|
# |
|
# The CAPA system is free software; you can redistribute it and/or |
|
# modify it under the terms of the GNU General Public License as |
|
# published by the Free Software Foundation; either version 2 of the |
|
# License, or (at your option) any later version. |
|
# |
|
# The CAPA system is distributed in the hope that it will be useful, |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
# General Public License for more details. |
|
# |
|
# You should have received a copy of the GNU General Public |
|
# License along with the CAPA system; see the file COPYING. If not, |
|
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
# |
|
# Boston, MA 02111-1307, USA. |
|
# As a special exception, you have permission to link this program |
|
# with the TtH/TtM library and distribute executables, as long as you |
|
# follow the requirements of the GNU GPL in regard to all of the |
|
# software in the executable aside from TtH/TtM. |
|
|
|
|
|
|
VER = 5.1 |
VER = 5.1 |
BUGFIX = 0 |
BUGFIX = 6 |
#CC = i486-linuxlibc1-gcc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\" |
#CC = i486-linuxlibc1-gcc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\" |
CC = cc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y-%H:%M'`\" |
CC = cc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y-%H:%M'`\" |
CFLAG = -g -Wall |
DEF = -DUSE_DYNAMIC_SYMBOLS $(TTH_DEF) #-DLEX_DBUG |
DEF = -DUSE_DYNAMIC_SYMBOLS |
LEX = flex -Cfa -s |
LEX = flex |
|
YACC = bison |
YACC = bison |
AR = ar |
AR = ar |
MV = mv |
MV = mv |
Line 19 LEXFLAG = -v
|
Line 41 LEXFLAG = -v
|
|
|
# OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX |
# OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX |
|
|
|
TTH_SRC= |
|
#TTH_SRC=../../tth/tthdynamic/tthfunc.c |
|
TTH_OBJ= |
|
#TTH_OBJ=$(ARCH)/tthfunc.o |
|
TTH_DEF= |
|
#TTH_DEF=-DTTH |
|
|
ARCH = $(shell uname) |
ARCH = $(shell uname) |
|
LONCAPA = |
|
Linux = /usr/lib/libncurses.a |
OSF1 = -lcurses #-ltermcap |
OSF1 = -lcurses #-ltermcap |
SunOS = /home/capa/source/lib/libncurses.a |
SunOS = /home/capa/source/lib/libncurses.a |
Linux = /usr/lib/libncurses.a |
Linux = /usr/lib/libncurses.a |
NEXTSTEP = -lcurses -ltermcap |
NEXTSTEP = -lcurses -ltermcap |
HP-UX = -lcurses -ltermcap |
HP-UX = -lcurses -ltermcap |
IRIX = -lcurses -ltermcap |
IRIX = -lcurses -ltermcap |
Line 32 P_FLAGS = -lfl -lm
|
Line 63 P_FLAGS = -lfl -lm
|
|
|
S_FLAGS = $($(ARCH)) $(P_FLAGS) |
S_FLAGS = $($(ARCH)) $(P_FLAGS) |
|
|
|
LONCAPAFLAG = -DLONCAPA -fPIC -Dbool=char -DHAS_BOOL -D_REENTRANT |
OSF1FLAG = -O3 -Olimit 2048 |
OSF1FLAG = -O3 -Olimit 2048 |
|
AIXFLAG=-O3 -DAIX $(DEF) |
#ARCH = $(shell uname) |
NEXTSTEPFLAG=-arch i386 -arch m68k $(DEF) |
# Architecture speicifc subdirectory |
SunOSFLAG=-xO3 $(DEF) |
# output from uname command |
HP-UXFLAG=-O -Ae -Dhpux $(DEF) |
# |
IRIXFLAG=-O2 -DIRIX $(DEF) |
# Architectural note: |
LinuxFLAG=-O2 -Wall $(DEF) |
# on NeXT compiling libcapa after the final step, |
|
# ranlib libcapa4.5.a |
CFLAG=$($(ARCH)FLAG) |
# |
|
# HP-UX |
PAR_SRC = capaLexerFun.c capaParserFun.c capaFormulaParser.c capaFunction.c \ |
# alloca() could not linked by ld |
capaParserUtils.c capaMapExpr.c capaUnit.c com.c linpack.c ranlib.c \ |
# file capaParserFun.c contains alloca definition |
capaCgiUtils.c capaSubjective.c capaRQO.c capaFormulaLexer.c \ |
# add <stdlib.h> and <alloca.h> after __hpux |
capaFormulaParser.c capaCommon.c $(TTH_SRC) |
# gmake is not available on HP-UX DECS |
|
|
|
PAR_SRC = capaCommon.c capaLexerFun.c \ |
|
capaParserFun.c capaFunction.c capaParserUtils.c \ |
|
capaMapExpr.c capaUnit.c com.c linpack.c ranlib.c \ |
|
capaCgiUtils.c capaSubjective.c capaRQO.c capaFormulaLexer.c capaFormulaParser.c |
|
|
|
UNIT_SRC = capaUnit.c |
|
|
|
|
|
P_SRC_DIST = pProj/Makefile \ |
|
pProj/capaCommon.c pProj/capaLexerFun.c \ |
|
pProj/capaParserFun.c pProj/capaFunction.c \ |
|
pProj/capaMapExpr.c \ |
|
pProj/com.c pProj/linpack.c \ |
|
pProj/ranlib.c \ |
|
pProj/capaCommon.h pProj/capaFunction.h \ |
|
pProj/capaParser.h pProj/capaToken.h \ |
|
pProj/ranlib.h pProj/lex_debug.h \ |
|
pProj/allcapaid.c pProj/capalogin.c \ |
|
pProj/qztotex.c pProj/capaUnit.c \ |
|
pProj/qzparse.c pProj/capaCgiUtils.c \ |
|
pProj/capaCGI.h pProj/capaHTML.c \ |
|
pProj/capaSubjective.c pProj/capaFormula.h \ |
|
pProj/capaFormulaLexer.c pProj/capaFormulaParser.c pProj/capaParserUtils.c |
|
|
|
BIN_DIST = pProj/$(ARCH)/capalogin pProj/$(ARCH)/qztotex pProj/$(ARCH)/allcapaid pProj/$(ARCH)/qzparse #pProj/$(ARCH)/setdbheader |
|
BIN_DIST_NOPATH = capalogin allcapaid qzparse capahtml capasbin |
|
|
|
PAR_OBJ = $(PAR_SRC:.c=.o) |
PAR_OBJ = $(PAR_SRC:.c=.o) |
|
|
UNIT_OBJ = $(UNIT_SRC:.c=.o) |
ARCH_OBJ = $(ARCH)/capaFormulaParser.o $(ARCH)/capaLexerFun.o $(ARCH)/capaParserFun.o \ |
|
$(ARCH)/capaFunction.o $(ARCH)/capaParserUtils.o $(ARCH)/capaMapExpr.o \ |
ARCH_OBJ = $(ARCH)/capaCommon.o $(ARCH)/capaLexerFun.o \ |
$(ARCH)/capaUnit.o $(ARCH)/com.o $(ARCH)/linpack.o $(ARCH)/ranlib.o \ |
$(ARCH)/capaParserFun.o $(ARCH)/capaFunction.o \ |
$(ARCH)/capaCgiUtils.o $(ARCH)/capaSubjective.o $(ARCH)/capaRQO.o \ |
$(ARCH)/capaUnit.o \ |
$(ARCH)/capaFormulaLexer.o $(ARCH)/capaCommon.o $(TTH_OBJ) |
$(ARCH)/capaCgiUtils.o $(ARCH)/capaSubjective.o \ |
|
$(ARCH)/capaMapExpr.o $(ARCH)/com.o \ |
|
$(ARCH)/linpack.o $(ARCH)/ranlib.o $(ARCH)/capaRQO.o \ |
|
$(ARCH)/capaFormulaLexer.o $(ARCH)/capaFormulaParser.o $(ARCH)/capaParserUtils.o |
|
|
|
## =================================================================== |
## =================================================================== |
|
|
# conditional macros in alpha |
# conditional macros in alpha |
Line 94 ARCH_OBJ = $(ARCH)/capaCommon.o $(A
|
Line 93 ARCH_OBJ = $(ARCH)/capaCommon.o $(A
|
# libcapa:=MACRO=string |
# libcapa:=MACRO=string |
|
|
|
|
all: libcapa capalogin capahtml capasbin allcapaid qzparse |
all: $(ARCH) $(ARCH)/libcapa$(VER).a $(ARCH)/qzparse $(ARCH)/capalogin $(ARCH)/capahtml $(ARCH)/capasbin $(ARCH)/allcapaid |
|
|
|
$(ARCH): |
|
mkdir $(ARCH) |
|
|
dmalloc: |
dmalloc: |
$(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa capasbin #qzparse |
$(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa capasbin |
|
|
|
libcapa: $(ARCH)/libcapa$(VER).a |
|
|
|
$(ARCH)/capalogin: $(ARCH)/capalogin.o $(ARCH)/libcapa$(VER).a |
|
$(CC) $(CFLAG) -o $@ $^ $(S_FLAGS) |
|
|
|
capalogin: $(ARCH)/capalogin |
|
true |
|
|
|
$(ARCH)/capahtml: capaHTML.c $(ARCH)/libcapa$(VER).a |
|
$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS) |
|
|
|
capahtml: $(ARCH)/capahtml |
|
true |
|
|
libcapa: |
$(ARCH)/capasbin: capaHTML.c $(ARCH)/libcapa$(VER).a |
$(MAKE) objdir |
$(CC) $(CFLAG) -o $@ $< -DCAPA_WEB $(ARCH)/libcapa$(VER).a $(P_FLAGS) |
$(MAKE) allobj |
|
if test -f $(ARCH)/libcapa$(VER).a ; then $(RM) $(ARCH)/libcapa$(VER).a ; fi |
|
(cd $(ARCH); $(AR) q libcapa$(VER).a $(PAR_OBJ) ) |
|
if test $(ARCH) = "NEXTSTEP" ; then \ |
|
(cd $(ARCH); ranlib libcapa$(VER).a ) ; fi |
|
|
|
|
capasbin: $(ARCH)/capasbin |
|
true |
|
|
|
$(ARCH)/allcapaid: allcapaid.c $(ARCH)/libcapa$(VER).a |
|
$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS) |
|
|
|
allcapaid: $(ARCH)/allcapaid |
|
true |
|
|
|
$(ARCH)/qzparse: qzparse.c $(ARCH)/libcapa$(VER).a |
|
$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS) |
|
|
|
qzparse: $(ARCH)/qzparse |
|
true |
|
|
|
$(ARCH)/libcapa$(VER).a: $(ARCH) $(ARCH_OBJ) $(PAR_SRC) |
|
$(AR) r $(ARCH)/libcapa$(VER).a $(ARCH_OBJ) |
|
|
binclean: |
binclean: |
$(RM) $(ARCH)/*.o $(ARCH)/*.a |
$(RM) $(ARCH)/*.o $(ARCH)/*.a |
|
|
|
$(ARCH)/%.o: %.c capaToken.h |
|
$(CC) $(CFLAG) -c $< -o $@ $(DEF) |
|
|
package: |
$(ARCH)/tthfunc.o: $(TTH_SRC) |
@(cd $(ARCH);tar cvvf ../capabin.`uname`.$(VER).tar $(BIN_DIST_NOPATH) ) |
$(CC) $(CFLAG) -c $< -o $@ $(DEF) |
|
|
|
|
dist: libcapa capalogin qztotex allcapaid |
$(ARCH)/convert: $(ARCH)libcapa($VER).a $(ARCH)/convert.o |
@(cd $(ARCH);tar cvvf ../../parser.bin.`uname`.$(VER).tar $(BIN_DIST_NOPATH) ) |
$(CC) $(CFLAG) $(DEF) -o $@ $(ARCH)/convert.o -L$(ARCH) -lcapa$(VER) $(P_FLAGS) |
|
|
|
capaToken.h: capaGrammarDef.y |
|
$(YACC) -y -d $< --output=capaParserFun.c |
|
mv capaParserFun.h capaToken.h |
|
|
|
capaFormula.h: capaFormula.y |
|
$(YACC) -y -d $< -p fml_ --output=$@ |
|
mv capaFormulaParser.h capaFormula.h |
|
|
|
capaParserFun.c: capaGrammarDef.y |
|
$(YACC) -y -d $< --output=$@ |
|
mv capaParserFun.h capaToken.h |
|
|
|
capaLexerFun.c: capaLexerDef.flex capaToken.h |
|
$(LEX) -o$@ $< |
|
|
|
capaFormulaParser.c: capaFormula.y |
|
$(YACC) -y -d $< -p fml_ --output=$@ |
|
mv capaFormulaParser.h capaFormula.h |
|
|
|
clean: |
|
rm -f $(ARCH)/*.o |
|
rm -f $(ARCH)/libcapa$(VER).a |
|
rm -f capaToken.h capaParserFun.c capaLexerFun.c capaFormula.h \ |
|
capaFormulaParser.c |
|
|
capadist: libcapa capalogin qztotex allcapaid |
|
@(cd $(ARCH);tar uvvf ../../capa.bin.`uname`.$(CAPA_VER).tar $(BIN_DIST_NOPATH) ) |
|
|
|
|
|
srcdist: |
|
@(cd ..;tar cvvf parser.src.$(VER).tar $(P_SRC_DIST) ) |
|
|
|
|
|
capasrcdist: |
|
@(cd ..;tar uvvf capa.src.$(CAPA_VER).tar $(P_SRC_DIST) ) |
|
|
|
# ---------------------------------------------------------------- |
|
|
|
objdir: |
|
-@ [ -d $(ARCH) ] || ( mkdir $(ARCH); chmod 755 $(ARCH) ) |
|
|
|
allobj: |
|
( ofile="" ; \ |
|
cfile="" ; \ |
|
prefix="" ; \ |
|
CCFLAG="$(CFLAG) $(DEF)";\ |
|
if test $(ARCH) = "AIX" ; then CCFLAG="-O3 -DAIX $(DEF)"; fi;\ |
|
if test $(ARCH) = "OSF1" ; then CCFLAG="$(OSF1FLAG) $(DEF)"; fi;\ |
|
if test $(ARCH) = "NEXTSTEP" ; then CCFLAG="-arch i386 -arch m68k $(DEF)"; fi;\ |
|
if test $(ARCH) = "SunOS" ; then CCFLAG="-xO3 $(DEF)"; fi;\ |
|
if test $(ARCH) = "HP-UX" ; then CCFLAG="-O -Ae -Dhpux $(DEF)"; fi;\ |
|
if test $(ARCH) = "IRIX" ; then CCFLAG="-O2 -DIRIX $(DEF)"; fi;\ |
|
for prefix in $(PAR_SRC:.c=) out ; do \ |
|
if [ $${prefix} = "out" ] ; then break; fi ; \ |
|
cfile="$$prefix.c" ; \ |
|
ofile="./$(ARCH)/$$prefix.o" ; \ |
|
cmd="$(CC) $$CCFLAG -c $$cfile -o $$ofile"; \ |
|
echo $$cmd ; \ |
|
$$cmd ; \ |
|
done ) |
|
|
|
.c.o: |
|
echo "TARGET:"$@ |
|
echo "DEPEND:"$< |
|
|
|
capalogin : |
|
(CCFLAG="$(CFLAG) $(DEF)";\ |
|
if test $(ARCH) = "AIX" ; then CCFLAG="-O3 -DAIX $(DEF)"; fi;\ |
|
if test $(ARCH) = "OSF1" ; then CCFLAG="$(OSF1FLAG) $(DEF)"; fi;\ |
|
if test $(ARCH) = "SunOS" ; then CCFLAG="-xO3 $(DEF)"; fi;\ |
|
if test $(ARCH) = "HP-UX" ; then CCFLAG="-O -Ae -Dhpux $(DEF)"; fi;\ |
|
if test $(ARCH) = "NEXTSTEP" ; then CCFLAG="-arch i386 -arch m68k $(DEF)"; fi;\ |
|
if test $(ARCH) = "IRIX" ; then CCFLAG="-O2 -DIRIX $(DEF)"; fi;\ |
|
CMD="$(CC) $$CCFLAG -o $(ARCH)/$@ $@.c -L$(ARCH) -lcapa$(VER) $(S_FLAGS)"; \ |
|
echo $$CMD ;\ |
|
$$CMD ) |
|
$(STRIP) $(ARCH)/$@ |
|
|
|
allcapaid qzparse: |
|
(CCFLAG="$(CFLAG) $(DEF)";\ |
|
if test $(ARCH) = "AIX" ; then CCFLAG="-O3 -DAIX $(DEF)"; fi;\ |
|
if test $(ARCH) = "OSF1" ; then CCFLAG="$(OSF1FLAG) $(DEF)"; fi;\ |
|
if test $(ARCH) = "SunOS" ; then CCFLAG="-xO3 $(DEF)"; fi;\ |
|
if test $(ARCH) = "HP-UX" ; then CCFLAG="-O -Ae -Dhpux $(DEF)"; fi;\ |
|
if test $(ARCH) = "NEXTSTEP" ; then CCFLAG="-arch i386 -arch m68k $(DEF)"; fi;\ |
|
if test $(ARCH) = "IRIX" ; then CCFLAG="-O2 -DIRIX $(DEF)"; fi;\ |
|
CMD="$(CC) $$CCFLAG -o $(ARCH)/$@ $@.c -L$(ARCH) -lcapa$(VER) $(P_FLAGS)"; \ |
|
echo $$CMD ;\ |
|
$$CMD ) |
|
$(STRIP) $(ARCH)/$@ |
|
|
|
capahtml capasbin: |
|
(CCFLAG="$(CFLAG) $(DEF)";\ |
|
if test $(ARCH) = "AIX" ; then CCFLAG="-O3 -DAIX $(DEF)"; fi;\ |
|
if test $(ARCH) = "OSF1" ; then CCFLAG="$(OSF1FLAG) $(DEF)"; fi;\ |
|
if test $(ARCH) = "SunOS" ; then CCFLAG="-xO3 $(DEF)"; fi;\ |
|
if test $(ARCH) = "HP-UX" ; then CCFLAG="-O -Ae -Dhpux $(DEF)"; fi;\ |
|
if test $(ARCH) = "NEXTSTEP" ; then CCFLAG="-arch i386 -arch m68k $(DEF)"; fi;\ |
|
if test $(ARCH) = "IRIX" ; then CCFLAG="-O2 -DIRIX $(DEF)"; fi;\ |
|
if test $@ = capasbin ; then WDEFS="-DCAPA_WEB" ; fi; \ |
|
CMD="$(CC) $$CCFLAG -o $(ARCH)/$@ capaHTML.c $$WDEFS -L$(ARCH) -lcapa$(VER) $(P_FLAGS)"; \ |
|
echo $$CMD ;\ |
|
$$CMD ) |
|
$(STRIP) $(ARCH)/$@ |
|
|
|
|
|
cleanup: |
|
$(RM) -f *.o |
|
|
|
tags: |
|
etags *.[ch] |
|
|
|
depend: |
|
makedepend -- $(CFLAG) -- *.[ch] |
|
|
|
|
|
# ||<===================================================================>|| |
|
## ========================================================================= |
|
# /usr/ccs/lib/liby.a(libmai.o) has a main, |
|
# /usr/ucblib/libcurses should come before .c file. |
|
## ========================================================================= |
|