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 (13 years, 11 months 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.

# ==================================================================
#     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
BUGFIX = 6
#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'`\" 
DEF = -DUSE_DYNAMIC_SYMBOLS $(TTH_DEF) #-DLEX_DBUG 
LEX = flex -Cfa -s
YACC = bison
AR = ar
MV = mv
RM = rm
STRIP = echo 
#STRIP = strip
LEXFLAG = -v

# 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)
LONCAPA =
Linux = /usr/lib/libncurses.a 
OSF1 = -lcurses #-ltermcap
SunOS = /home/capa/source/lib/libncurses.a
Linux = /usr/lib/libncurses.a 
NEXTSTEP = -lcurses -ltermcap
HP-UX = -lcurses -ltermcap
IRIX = -lcurses -ltermcap
FreeBSD = -lncurses -ltermcap

P_FLAGS =  -lfl -lm 

S_FLAGS =  $($(ARCH)) $(P_FLAGS)

LONCAPAFLAG = -DLONCAPA -fPIC -Dbool=char -DHAS_BOOL -D_REENTRANT
OSF1FLAG = -O3 -Olimit 2048
AIXFLAG=-O3 -DAIX $(DEF)
NEXTSTEPFLAG=-arch i386 -arch m68k $(DEF)
SunOSFLAG=-xO3 $(DEF)
HP-UXFLAG=-O -Ae -Dhpux $(DEF)
IRIXFLAG=-O2 -DIRIX $(DEF)
LinuxFLAG=-O2 -Wall $(DEF)

CFLAG=$($(ARCH)FLAG)

PAR_SRC = capaLexerFun.c capaParserFun.c capaFormulaParser.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 capaCommon.c $(TTH_SRC)

PAR_OBJ = $(PAR_SRC:.c=.o)

ARCH_OBJ = $(ARCH)/capaFormulaParser.o $(ARCH)/capaLexerFun.o $(ARCH)/capaParserFun.o \
	   $(ARCH)/capaFunction.o $(ARCH)/capaParserUtils.o $(ARCH)/capaMapExpr.o \
	   $(ARCH)/capaUnit.o $(ARCH)/com.o $(ARCH)/linpack.o $(ARCH)/ranlib.o \
           $(ARCH)/capaCgiUtils.o $(ARCH)/capaSubjective.o $(ARCH)/capaRQO.o \
	   $(ARCH)/capaFormulaLexer.o $(ARCH)/capaCommon.o $(TTH_OBJ)
## ===================================================================

#  conditional macros in alpha 
#
# libcapa:=MACRO=string


all: $(ARCH) $(ARCH)/libcapa$(VER).a $(ARCH)/qzparse $(ARCH)/capalogin $(ARCH)/capahtml $(ARCH)/capasbin $(ARCH)/allcapaid 

$(ARCH): 
	mkdir $(ARCH)

dmalloc: 
	$(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

$(ARCH)/capasbin: capaHTML.c $(ARCH)/libcapa$(VER).a
	$(CC) $(CFLAG) -o $@ $< -DCAPA_WEB $(ARCH)/libcapa$(VER).a $(P_FLAGS)

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:
	$(RM) $(ARCH)/*.o $(ARCH)/*.a

$(ARCH)/%.o: %.c capaToken.h 
	$(CC) $(CFLAG) -c $< -o $@ $(DEF)

$(ARCH)/tthfunc.o: $(TTH_SRC)
	$(CC) $(CFLAG) -c $< -o $@ $(DEF)

$(ARCH)/convert: $(ARCH)libcapa($VER).a $(ARCH)/convert.o
	$(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

capaForumla.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


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