Annotation of loncom/homework/CAPA-converter/Makefile, revision 1.5
1.1 albertel 1: # ==================================================================
2: # Makefile for CAPA 5.1
3: # ==================================================================
4:
5: VER = 5.1
6: BUGFIX = 0
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'`\"
1.4 albertel 9: DEF = -DUSE_DYNAMIC_SYMBOLS -D_GNU_SOURCE#-DLEX_DBUG
1.1 albertel 10: CFLAG = -g -Wall
11: LEX = flex -Cfa -s
12: YACC = bison
13: AR = ar
14: MV = mv
15: RM = rm
16: STRIP = echo
17: #STRIP = strip
18: LEXFLAG = -v
19:
20: # OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX
21:
22: ARCH = $(shell uname)
23: Linux = /usr/lib/libncurses.a
24:
25: P_FLAGS = -ll -lm
26:
27: S_FLAGS = $($(ARCH)) $(P_FLAGS)
28:
29: OSF1FLAG = -O3 -Olimit 2048
30:
31: #ARCH = $(shell uname)
32: # Architecture speicifc subdirectory
33: # output from uname command
34: #
35: # Architectural note:
36: # on NeXT compiling libcapa after the final step,
37: # ranlib libcapa4.5.a
38: #
39: # HP-UX
40: # alloca() could not linked by ld
41: # file capaParserFun.c contains alloca definition
42: # add <stdlib.h> and <alloca.h> after __hpux
43: # gmake is not available on HP-UX DECS
44:
45: PAR_SRC = capaCommon.c capaFunction.c capaParserFun.c capaLexerFun.c
46:
47: PAR_OBJ = $(PAR_SRC:.c=.o)
48:
49: ARCH_OBJ = $(ARCH)/capaCommon.o $(ARCH)/capaLexerFun.o \
50: $(ARCH)/capaParserFun.o
51: ## ===================================================================
52:
53: # conditional macros in alpha
54: #
55: # libcapa:=MACRO=string
56:
57:
1.5 ! albertel 58: convert: $(ARCH) $(ARCH)/convert
1.1 albertel 59: echo done
60:
1.5 ! albertel 61: all: $(ARCH) $(ARCH)libcapa($VER).a $(ARCH)/convert
! 62:
! 63: $(ARCH):
! 64: mkdir $(ARCH)
1.1 albertel 65:
66: dmalloc:
1.2 albertel 67: $(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa convert
1.1 albertel 68:
69: $(ARCH)libcapa($VER).a: $(ARCH_OBJ)
70: $(AR) r $(ARCH)/libcapa$(VER).a $(ARCH_OBJ)
71:
72: binclean:
73: $(RM) $(ARCH)/*.o $(ARCH)/*.a
74:
75: $(ARCH)/%.o: %.c capaToken.h
76: $(CC) $(CFLAG) -c $< -o $@ $(DEF)
77:
1.2 albertel 78: $(ARCH)/convert: $(ARCH)libcapa($VER).a $(ARCH)/convert.o
79: $(CC) $(CFLAG) $(DEF) -o $@ $(ARCH)/convert.o -L$(ARCH) -lcapa$(VER) $(P_FLAGS)
1.1 albertel 80:
81: capaToken.h: capaParserFun.c
82:
83: capaParserFun.c: capaGrammarDef.y
84: $(YACC) -d $< --output=$@
85: mv capaParserFun.h capaToken.h
86:
87: capaLexerFun.c: capaLexerDef.flex capaToken.h
88: $(LEX) -o$@ $<
89:
90: clean:
1.5 ! albertel 91: rm -f $(ARCH)/*.o
! 92: rm -f $(ARCH)/libcapa$(VER).a
! 93: rm -f capaToken.h
! 94: rm -f capaParserFun.c
! 95: rm -f capaLexerFun.c
1.1 albertel 96:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>