Annotation of loncom/homework/CAPA-converter/Makefile, revision 1.8

1.7       albertel    1: # The LearningOnline Network with CAPA
1.1       albertel    2: #     Makefile for CAPA 5.1
1.7       albertel    3: #
1.8     ! albertel    4: # $Id: Makefile,v 1.7 2001/12/04 15:17:56 albertel Exp $
1.7       albertel    5: #
                      6: # Copyright Michigan State University Board of Trustees
                      7: #
                      8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      9: #
                     10: # LON-CAPA is free software; you can redistribute it and/or modify
                     11: # it under the terms of the GNU General Public License as published by
                     12: # the Free Software Foundation; either version 2 of the License, or
                     13: # (at your option) any later version.
                     14: #
                     15: # LON-CAPA is distributed in the hope that it will be useful,
                     16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     18: # GNU General Public License for more details.
                     19: #
                     20: # You should have received a copy of the GNU General Public License
                     21: # along with LON-CAPA; if not, write to the Free Software
                     22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     23: #
                     24: # /home/httpd/html/adm/gpl.txt
                     25: #
                     26: # http://www.lon-capa.org/
                     27: #
1.1       albertel   28: 
                     29: VER = 5.1
                     30: BUGFIX = 0
                     31: #CC = i486-linuxlibc1-gcc  -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\" 
                     32: CC = cc  -DCAPA_VER=\"$(VER).$(BUGFIX)\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y-%H:%M'`\" 
1.4       albertel   33: DEF = -DUSE_DYNAMIC_SYMBOLS -D_GNU_SOURCE#-DLEX_DBUG 
1.1       albertel   34: CFLAG = -g -Wall 
                     35: LEX = flex -Cfa -s
                     36: YACC = bison
                     37: AR = ar
                     38: MV = mv
                     39: RM = rm
                     40: STRIP = echo 
                     41: #STRIP = strip
                     42: LEXFLAG = -v
                     43: 
                     44: # OSF1, SunOS, Linux, NEXTSTEP, HP-UX, IRIX
                     45: 
                     46: ARCH = $(shell uname)
                     47: Linux = /usr/lib/libncurses.a 
                     48: 
1.8     ! albertel   49: P_FLAGS =  -lfl -lm 
1.1       albertel   50: 
                     51: S_FLAGS =  $($(ARCH)) $(P_FLAGS)
                     52: 
                     53: OSF1FLAG = -O3 -Olimit 2048
                     54: 
                     55: #ARCH = $(shell uname)
                     56: #  Architecture speicifc subdirectory
                     57: #  output from uname command
                     58: #
                     59: # Architectural note:
                     60: #  on NeXT compiling libcapa   after the final step, 
                     61: #  ranlib libcapa4.5.a
                     62: # 
                     63: #  HP-UX
                     64: #    alloca() could not linked by ld
                     65: #    file capaParserFun.c contains alloca definition
                     66: #      add <stdlib.h> and <alloca.h> after __hpux
                     67: #    gmake is not available on HP-UX DECS
                     68: 
                     69: PAR_SRC = capaCommon.c capaFunction.c capaParserFun.c capaLexerFun.c 
                     70: 
                     71: PAR_OBJ = $(PAR_SRC:.c=.o)
                     72: 
                     73: ARCH_OBJ = $(ARCH)/capaCommon.o   $(ARCH)/capaLexerFun.o \
                     74:            $(ARCH)/capaParserFun.o   
                     75: ## ===================================================================
                     76: 
                     77: #  conditional macros in alpha 
                     78: #
                     79: # libcapa:=MACRO=string
                     80: 
                     81: 
1.5       albertel   82: convert: $(ARCH) $(ARCH)/convert
1.6       albertel   83: 	true
1.1       albertel   84: 
1.5       albertel   85: all: $(ARCH) $(ARCH)libcapa($VER).a $(ARCH)/convert 
                     86: 
                     87: $(ARCH): 
                     88: 	mkdir $(ARCH)
1.1       albertel   89: 
                     90: dmalloc: 
1.2       albertel   91: 	$(MAKE) DEF="-DDMALLOC -DDMALLOC_FUNC_CHECK $(DEF)" P_FLAGS="-ldmalloc $(P_FLAGS)" libcapa convert
1.1       albertel   92: 
1.6       albertel   93: $(ARCH)/libcapa$(VER).a: $(ARCH_OBJ)
1.1       albertel   94: 	$(AR) r $(ARCH)/libcapa$(VER).a $(ARCH_OBJ) 
                     95: 
                     96: binclean:
                     97: 	$(RM) $(ARCH)/*.o $(ARCH)/*.a
                     98: 
1.6       albertel   99: $(ARCH)/%.o: %.c capaCommon.h capaToken.h Makefile
1.1       albertel  100: 	$(CC) $(CFLAG) -c $< -o $@ $(DEF)
                    101: 
1.6       albertel  102: $(ARCH)/convert: $(ARCH)/libcapa$(VER).a $(ARCH)/convert.o
1.2       albertel  103: 	$(CC) $(CFLAG) $(DEF) -o $@ $(ARCH)/convert.o -L$(ARCH) -lcapa$(VER) $(P_FLAGS)
1.1       albertel  104: 
                    105: capaToken.h: capaParserFun.c
                    106: 
                    107: capaParserFun.c: capaGrammarDef.y
                    108: 	$(YACC) -d $< --output=$@
                    109: 	mv capaParserFun.h capaToken.h
                    110: 
                    111: capaLexerFun.c: capaLexerDef.flex capaToken.h
                    112: 	$(LEX) -o$@ $<
                    113: 
                    114: clean:
1.5       albertel  115: 	rm -f $(ARCH)/*.o
                    116: 	rm -f $(ARCH)/libcapa$(VER).a
                    117: 	rm -f capaToken.h
                    118: 	rm -f capaParserFun.c
                    119: 	rm -f capaLexerFun.c
1.1       albertel  120: 

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