File:  [LON-CAPA] / capa / capa51 / pProj / Makefile
Revision 1.23: download - view: text, annotated - select for diffs
Tue May 11 01:38:41 2010 UTC (14 years ago) by raeburn
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_1, version_2_9_0, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, HEAD, BZ4492-merge, BZ4492-feature_horizontal_radioresponse, BZ4492-feature_Support_horizontal_radioresponse, BZ4492-Support_horizontal_radioresponse
- Include -y option when calling bison so token definitions are included
  in header files: capaToken.h and capaFormula.h (in CAPA/pProj) created by bison.
  - This prevents errors when compiling capaFormulaLexer.c on distros
    using bison 2.4.1.

    1: # ==================================================================
    2: #     Makefile for CAPA 5.1
    3: # ==================================================================
    4: #  Copyright (C) 1992-2000 Michigan State University
    5: #
    6: #  The CAPA system is free software; you can redistribute it and/or
    7: #  modify it under the terms of the GNU General Public License as
    8: #  published by the Free Software Foundation; either version 2 of the
    9: #  License, or (at your option) any later version.
   10: #
   11: #  The CAPA system is distributed in the hope that it will be useful,
   12: #  but WITHOUT ANY WARRANTY; without even the implied warranty of
   13: #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14: #  General Public License for more details.
   15: #
   16: #  You should have received a copy of the GNU General Public
   17: #  License along with the CAPA system; see the file COPYING.  If not,
   18: #  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   19: #
   20: #  Boston, MA 02111-1307, USA. 
   21: #  As a special exception, you have permission to link this program
   22: #  with the TtH/TtM library and distribute executables, as long as you
   23: #  follow the requirements of the GNU GPL in regard to all of the
   24: #  software in the executable aside from TtH/TtM.
   25: 
   26: 
   27: 
   28: VER = 5.1
   29: BUGFIX = 6
   30: #CC = i486-linuxlibc1-gcc  -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\" 
   31: CC = cc  -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y-%H:%M'`\" 
   32: DEF = -DUSE_DYNAMIC_SYMBOLS $(TTH_DEF) #-DLEX_DBUG 
   33: LEX = flex -Cfa -s
   34: YACC = bison
   35: AR = ar
   36: MV = mv
   37: RM = rm
   38: STRIP = echo 
   39: #STRIP = strip
   40: LEXFLAG = -v
   41: 
   42: # OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX
   43: 
   44: TTH_SRC=
   45: #TTH_SRC=../../tth/tthdynamic/tthfunc.c
   46: TTH_OBJ=
   47: #TTH_OBJ=$(ARCH)/tthfunc.o
   48: TTH_DEF=
   49: #TTH_DEF=-DTTH
   50: 
   51: ARCH = $(shell uname)
   52: LONCAPA =
   53: Linux = /usr/lib/libncurses.a 
   54: OSF1 = -lcurses #-ltermcap
   55: SunOS = /home/capa/source/lib/libncurses.a
   56: Linux = /usr/lib/libncurses.a 
   57: NEXTSTEP = -lcurses -ltermcap
   58: HP-UX = -lcurses -ltermcap
   59: IRIX = -lcurses -ltermcap
   60: FreeBSD = -lncurses -ltermcap
   61: 
   62: P_FLAGS =  -lfl -lm 
   63: 
   64: S_FLAGS =  $($(ARCH)) $(P_FLAGS)
   65: 
   66: LONCAPAFLAG = -DLONCAPA -fPIC -Dbool=char -DHAS_BOOL -D_REENTRANT
   67: OSF1FLAG = -O3 -Olimit 2048
   68: AIXFLAG=-O3 -DAIX $(DEF)
   69: NEXTSTEPFLAG=-arch i386 -arch m68k $(DEF)
   70: SunOSFLAG=-xO3 $(DEF)
   71: HP-UXFLAG=-O -Ae -Dhpux $(DEF)
   72: IRIXFLAG=-O2 -DIRIX $(DEF)
   73: LinuxFLAG=-O2 -Wall $(DEF)
   74: 
   75: CFLAG=$($(ARCH)FLAG)
   76: 
   77: PAR_SRC = capaLexerFun.c capaParserFun.c capaFormulaParser.c capaFunction.c \
   78: 	  capaParserUtils.c capaMapExpr.c capaUnit.c com.c linpack.c ranlib.c \
   79:           capaCgiUtils.c capaSubjective.c capaRQO.c capaFormulaLexer.c \
   80: 	  capaFormulaParser.c capaCommon.c $(TTH_SRC)
   81: 
   82: PAR_OBJ = $(PAR_SRC:.c=.o)
   83: 
   84: ARCH_OBJ = $(ARCH)/capaFormulaParser.o $(ARCH)/capaLexerFun.o $(ARCH)/capaParserFun.o \
   85: 	   $(ARCH)/capaFunction.o $(ARCH)/capaParserUtils.o $(ARCH)/capaMapExpr.o \
   86: 	   $(ARCH)/capaUnit.o $(ARCH)/com.o $(ARCH)/linpack.o $(ARCH)/ranlib.o \
   87:            $(ARCH)/capaCgiUtils.o $(ARCH)/capaSubjective.o $(ARCH)/capaRQO.o \
   88: 	   $(ARCH)/capaFormulaLexer.o $(ARCH)/capaCommon.o $(TTH_OBJ)
   89: ## ===================================================================
   90: 
   91: #  conditional macros in alpha 
   92: #
   93: # libcapa:=MACRO=string
   94: 
   95: 
   96: all: $(ARCH) $(ARCH)/libcapa$(VER).a $(ARCH)/qzparse $(ARCH)/capalogin $(ARCH)/capahtml $(ARCH)/capasbin $(ARCH)/allcapaid 
   97: 
   98: $(ARCH): 
   99: 	mkdir $(ARCH)
  100: 
  101: dmalloc: 
  102: 	$(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa capasbin
  103: 
  104: libcapa: $(ARCH)/libcapa$(VER).a 
  105: 
  106: $(ARCH)/capalogin: $(ARCH)/capalogin.o $(ARCH)/libcapa$(VER).a 
  107: 	$(CC) $(CFLAG) -o $@ $^ $(S_FLAGS)
  108: 
  109: capalogin: $(ARCH)/capalogin 
  110: 	true
  111: 
  112: $(ARCH)/capahtml:  capaHTML.c $(ARCH)/libcapa$(VER).a 
  113: 	$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
  114: 
  115: capahtml: $(ARCH)/capahtml
  116: 	true
  117: 
  118: $(ARCH)/capasbin: capaHTML.c $(ARCH)/libcapa$(VER).a
  119: 	$(CC) $(CFLAG) -o $@ $< -DCAPA_WEB $(ARCH)/libcapa$(VER).a $(P_FLAGS)
  120: 
  121: capasbin: $(ARCH)/capasbin
  122: 	true
  123: 
  124: $(ARCH)/allcapaid: allcapaid.c $(ARCH)/libcapa$(VER).a
  125: 	$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
  126: 
  127: allcapaid: $(ARCH)/allcapaid
  128: 	true
  129: 
  130: $(ARCH)/qzparse: qzparse.c $(ARCH)/libcapa$(VER).a
  131: 	$(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
  132: 
  133: qzparse: $(ARCH)/qzparse
  134: 	true
  135: 
  136: $(ARCH)/libcapa$(VER).a: $(ARCH) $(ARCH_OBJ) $(PAR_SRC)
  137: 	$(AR) r $(ARCH)/libcapa$(VER).a $(ARCH_OBJ) 
  138: 
  139: binclean:
  140: 	$(RM) $(ARCH)/*.o $(ARCH)/*.a
  141: 
  142: $(ARCH)/%.o: %.c capaToken.h 
  143: 	$(CC) $(CFLAG) -c $< -o $@ $(DEF)
  144: 
  145: $(ARCH)/tthfunc.o: $(TTH_SRC)
  146: 	$(CC) $(CFLAG) -c $< -o $@ $(DEF)
  147: 
  148: $(ARCH)/convert: $(ARCH)libcapa($VER).a $(ARCH)/convert.o
  149: 	$(CC) $(CFLAG) $(DEF) -o $@ $(ARCH)/convert.o -L$(ARCH) -lcapa$(VER) $(P_FLAGS)
  150: 
  151: capaToken.h: capaGrammarDef.y
  152: 	$(YACC) -y -d $< --output=capaParserFun.c
  153: 	mv capaParserFun.h capaToken.h
  154: 
  155: capaForumla.h: capaFormula.y
  156: 	$(YACC) -y -d $< -p fml_ --output=$@
  157: 	mv capaFormulaParser.h capaFormula.h
  158: 
  159: capaParserFun.c: capaGrammarDef.y
  160: 	$(YACC) -y -d $< --output=$@
  161: 	mv capaParserFun.h capaToken.h
  162: 
  163: capaLexerFun.c: capaLexerDef.flex capaToken.h
  164: 	$(LEX) -o$@ $<
  165: 
  166: capaFormulaParser.c: capaFormula.y
  167: 	$(YACC) -y -d $< -p fml_ --output=$@
  168: 	mv capaFormulaParser.h capaFormula.h
  169: 
  170: clean:
  171: 	rm -f $(ARCH)/*.o
  172: 	rm -f $(ARCH)/libcapa$(VER).a
  173: 	rm -f capaToken.h capaParserFun.c capaLexerFun.c capaFormula.h \
  174: 		capaFormulaParser.c
  175: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>