1: # ==================================================================
2: # Makefile for CAPA 5.1
3: # ==================================================================
4:
5: VER = 5.1
6: BUGFIX = 1
7: #CC = i486-linuxlibc1-gcc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\"
8: CC = cc -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y-%H:%M'`\"
9: DEF = -DUSE_DYNAMIC_SYMBOLS $(TTH_DEF) #-DLEX_DBUG
10: LEX = flex -Cfa -s
11: YACC = bison
12: AR = ar
13: MV = mv
14: RM = rm
15: STRIP = echo
16: #STRIP = strip
17: LEXFLAG = -v
18:
19: # OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX
20:
21: #TTH_SRC=
22: TTH_SRC=../../tth/tthdynamic/tthfunc.c
23: #TTH_OBJ=
24: TTH_OBJ=$(ARCH)/tthfunc.o
25: #TTH_DEF=
26: TTH_DEF=-DTTH
27:
28: ARCH = $(shell uname)
29: Linux = /usr/lib/libncurses.a
30: OSF1 = -lcurses #-ltermcap
31: SunOS = /home/capa/source/lib/libncurses.a
32: Linux = /usr/lib/libncurses.a
33: NEXTSTEP = -lcurses -ltermcap
34: HP-UX = -lcurses -ltermcap
35: IRIX = -lcurses -ltermcap
36: FreeBSD = -lncurses -ltermcap
37:
38: P_FLAGS = -ll -lm
39:
40: S_FLAGS = $($(ARCH)) $(P_FLAGS)
41:
42: OSF1FLAG = -O3 -Olimit 2048
43: AIXFLAG=-O3 -DAIX $(DEF)
44: NEXTSTEPFLAG=-arch i386 -arch m68k $(DEF)
45: SunOSFLAG=-xO3 $(DEF)
46: HP-UXFLAG=-O -Ae -Dhpux $(DEF)
47: IRIXFLAG=-O2 -DIRIX $(DEF)
48: LinuxFLAG=-g -Wall $(DEF)
49:
50: CFLAG=$($(ARCH)FLAG)
51:
52: PAR_SRC = capaCommon.c capaLexerFun.c capaParserFun.c capaFunction.c \
53: capaParserUtils.c capaMapExpr.c capaUnit.c com.c linpack.c ranlib.c \
54: capaCgiUtils.c capaSubjective.c capaRQO.c capaFormulaLexer.c \
55: capaFormulaParser.c $(TTH_SRC)
56:
57: PAR_OBJ = $(PAR_SRC:.c=.o)
58:
59: ARCH_OBJ = $(ARCH)/capaCommon.o $(ARCH)/capaLexerFun.o $(ARCH)/capaParserFun.o \
60: $(ARCH)/capaFunction.o $(ARCH)/capaParserUtils.o $(ARCH)/capaMapExpr.o \
61: $(ARCH)/capaUnit.o $(ARCH)/com.o $(ARCH)/linpack.o $(ARCH)/ranlib.o \
62: $(ARCH)/capaCgiUtils.o $(ARCH)/capaSubjective.o $(ARCH)/capaRQO.o \
63: $(ARCH)/capaFormulaLexer.o $(ARCH)/capaFormulaParser.o $(TTH_OBJ)
64: ## ===================================================================
65:
66: # conditional macros in alpha
67: #
68: # libcapa:=MACRO=string
69:
70:
71: all: $(ARCH) $(ARCH)/libcapa$(VER).a $(ARCH)/qzparse $(ARCH)/capalogin $(ARCH)/capahtml $(ARCH)/capasbin $(ARCH)/allcapaid
72:
73: $(ARCH):
74: mkdir $(ARCH)
75:
76: dmalloc:
77: $(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa capasbin
78:
79: libcapa: $(ARCH)/libcapa$(VER).a
80:
81: $(ARCH)/capalogin: $(ARCH)/capalogin.o $(ARCH)/libcapa$(VER).a
82: $(CC) $(CFLAG) -o $@ $^ $(S_FLAGS)
83:
84: capalogin: $(ARCH)/capalogin
85: true
86:
87: $(ARCH)/capahtml: capaHTML.c $(ARCH)/libcapa$(VER).a
88: $(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
89:
90: capahtml: $(ARCH)/capahtml
91: true
92:
93: $(ARCH)/capasbin: capaHTML.c $(ARCH)/libcapa$(VER).a
94: $(CC) $(CFLAG) -o $@ $< -DCAPA_WEB $(ARCH)/libcapa$(VER).a $(P_FLAGS)
95:
96: capasbin: $(ARCH)/capasbin
97: true
98:
99: $(ARCH)/allcapaid: allcapaid.c $(ARCH)/libcapa$(VER).a
100: $(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
101:
102: allcapaid: $(ARCH)/allcapaid
103: true
104:
105: $(ARCH)/qzparse: qzparse.c $(ARCH)/libcapa$(VER).a
106: $(CC) $(CFLAG) -o $@ $< $(ARCH)/libcapa$(VER).a $(P_FLAGS)
107:
108: qzparse: $(ARCH)/qzparse
109: true
110:
111: $(ARCH)/libcapa$(VER).a: $(ARCH_OBJ) $(PAR_SRC)
112: $(AR) r $(ARCH)/libcapa$(VER).a $(ARCH_OBJ)
113:
114: binclean:
115: $(RM) $(ARCH)/*.o $(ARCH)/*.a
116:
117: $(ARCH)/%.o: %.c capaToken.h
118: $(CC) $(CFLAG) -c $< -o $@ $(DEF)
119:
120: $(ARCH)/tthfunc.o: $(TTH_SRC)
121: $(CC) $(CFLAG) -c $< -o $@ $(DEF)
122:
123: $(ARCH)/convert: $(ARCH)libcapa($VER).a $(ARCH)/convert.o
124: $(CC) $(CFLAG) $(DEF) -o $@ $(ARCH)/convert.o -L$(ARCH) -lcapa$(VER) $(P_FLAGS)
125:
126: capaToken.h: capaParserFun.c
127:
128: capaParserFun.c: capaGrammarDef.y
129: $(YACC) -d $< --output=$@
130: mv capaParserFun.h capaToken.h
131:
132: capaLexerFun.c: capaLexerDef.flex capaToken.h
133: $(LEX) -o$@ $<
134:
135: capaFormulaParser.c: capaFormula.y
136: $(YACC) -d $< -p fml_ --output=$@
137:
138: clean:
139: rm -f $(ARCH)/*.o
140: rm -f $(ARCH)/libcapa$(VER).a
141: rm -f capaToken.h
142: rm -f capaParserFun.c
143: rm -f capaLexerFun.c
144:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>