| 1 |
# ASCEND Compiler Makefile |
| 2 |
# Tom Epperly |
| 3 |
# modified Kirk Abbott to accept the interface. |
| 4 |
# $Date: 2000/01/25 02:25:50 $ |
| 5 |
# $Revision: 1.46 $ |
| 6 |
# $Author: ballan $ |
| 7 |
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/compiler/Makefile.in,v $ |
| 8 |
# |
| 9 |
|
| 10 |
|
| 11 |
SHELL = /bin/sh |
| 12 |
builddir = .. |
| 13 |
srcdir = @srcdir@/../generic |
| 14 |
VPATH = @srcdir@/../generic |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
# The next variables are the primary executables and/or libraries that |
| 19 |
# this makefile is responsible for, and the default target of this |
| 20 |
# makefile. |
| 21 |
|
| 22 |
EXECUTABLE = ascend |
| 23 |
|
| 24 |
PURIFIED_EXEC = ascendp |
| 25 |
|
| 26 |
QUANTIFIED_EXEC = ascendq |
| 27 |
|
| 28 |
LIBRARY = libasc.a |
| 29 |
|
| 30 |
|
| 31 |
default: $(LIBRARY) |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
# Defines and Includes that are specific to this directory |
| 36 |
|
| 37 |
DIR_SPECIFIC_DEFS = |
| 38 |
DIR_SPECIFIC_INCS = |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
# The next variables list the source files (EXEC_SCRS) to compile |
| 43 |
# into the object files (EXEC_OBJS) that are linked with the |
| 44 |
# library files (EXEC_LIBS) to make EXECUTABLE |
| 45 |
|
| 46 |
EXEC_SRCS = actype.c interface.c license.c main.c termsetup.c |
| 47 |
|
| 48 |
EXEC_OBJS = actype.o interface.o license.o main.o termsetup.o \ |
| 49 |
$(ARCHIVE)/libasc.a $(ARCHIVE)/libutils.a \ |
| 50 |
$(ARCHIVE)/libgeneral.a |
| 51 |
|
| 52 |
EXEC_LIBS = $(DEBUG_MALLOC_LIBS) $(MATH_LIBS) -ltermcap $(DEBUG_LIBS) |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
# The next variables list the source files (LIB_SCRS) to compile |
| 57 |
# into the object files (LIB_OBJS) that are combined to make LIBRARY |
| 58 |
|
| 59 |
LIB_SRCS = \ |
| 60 |
anoncopy.c anonmerg.c anontype.c arrayinst.c ascCompiler.c \ |
| 61 |
ascParse.c atomsize.c atomvalue.c bintoken.c bit.c braced.c \ |
| 62 |
case.c check.c child.c childdef.c childio.c childinfo.c cmpfunc.c \ |
| 63 |
commands.c copyinst.c createinst.c destroyinst.c \ |
| 64 |
dimen.c dimen_io.c dump.c \ |
| 65 |
evaluate.c exprio.c exprs.c exprsym.c extcall.c \ |
| 66 |
extfunc.c extinst.c find.c forvars.c fractions.c \ |
| 67 |
freestore.c func.c initialize.c instance.c instance_io.c \ |
| 68 |
instantiate.c instmacro.c instquery.c interval.c \ |
| 69 |
library.c linkinst.c logrel_io.c logrel_util.c \ |
| 70 |
logrelation.c mathinst.c mergeinst.c module.c name.c \ |
| 71 |
nameio.c notate.c numlist.c packages.c parentchild.c \ |
| 72 |
parpend.c pending.c proc.c procframe.c \ |
| 73 |
procio.c prototype.c refineinst.c rel_common.c relation.c \ |
| 74 |
relation_io.c relation_util.c rootfind.c rounded.c safe.c \ |
| 75 |
scanner.c select.c setinst_io.c setinstval.c setio.c \ |
| 76 |
sets.c slist.c simlist.c statement.c statio.c switch.c \ |
| 77 |
symtab.c syntax.c temp.c tmpnum.c type_desc.c \ |
| 78 |
type_descio.c typedef.c typelint.c redirectFile.c \ |
| 79 |
units.c universal.c \ |
| 80 |
value_type.c visitinst.c visitlink.c vlist.c vlistio.c \ |
| 81 |
watchpt.c watchptio.c when.c when_io.c when_util.c |
| 82 |
|
| 83 |
LIB_OBJS = \ |
| 84 |
anoncopy.o anonmerg.o anontype.o arrayinst.o ascCompiler.o \ |
| 85 |
ascParse.o atomsize.o atomvalue.o bintoken.o bit.o braced.o \ |
| 86 |
case.o check.o child.o childdef.o childio.o childinfo.o cmpfunc.o \ |
| 87 |
commands.o copyinst.o createinst.o destroyinst.o \ |
| 88 |
dimen.o dimen_io.o dump.o \ |
| 89 |
evaluate.o exprio.o exprs.o exprsym.o extcall.o \ |
| 90 |
extfunc.o extinst.o find.o forvars.o fractions.o \ |
| 91 |
freestore.o func.o initialize.o instance.o instance_io.o \ |
| 92 |
instantiate.o instmacro.o instquery.o interval.o \ |
| 93 |
library.o linkinst.o logrel_io.o logrel_util.o \ |
| 94 |
logrelation.o mathinst.o mergeinst.o module.o name.o \ |
| 95 |
nameio.o notate.o numlist.o packages.o parentchild.o \ |
| 96 |
parpend.o pending.o proc.o procframe.o \ |
| 97 |
procio.o prototype.o refineinst.o rel_common.o relation.o \ |
| 98 |
relation_io.o relation_util.o rootfind.o rounded.o safe.o \ |
| 99 |
scanner.o select.o setinst_io.o setinstval.o setio.o \ |
| 100 |
sets.o slist.o simlist.o statement.o statio.o switch.o \ |
| 101 |
symtab.o syntax.o temp.o tmpnum.o type_desc.o \ |
| 102 |
type_descio.o typedef.o typelint.o redirectFile.o \ |
| 103 |
units.o universal.o \ |
| 104 |
value_type.o visitinst.o visitlink.o vlist.o vlistio.o \ |
| 105 |
watchpt.o watchptio.o when.o when_io.o when_util.o |
| 106 |
|
| 107 |
# The global makefile macros (ConfigAscend) and global rules (Makefile.Rules) |
| 108 |
# |
| 109 |
include $(builddir)/ConfigAscend |
| 110 |
include $(builddir)/Makefile.Rules |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
# File specific rules |
| 115 |
|
| 116 |
# The parser needs some massaging to change the prefix from `yy' to `zz_' |
| 117 |
|
| 118 |
ascParse.o: $(srcdir)/ascParse.y |
| 119 |
|
| 120 |
ascParse.c ascParse.h: $(srcdir)/ascParse.y |
| 121 |
$(YACC) -d $(srcdir)/ascParse.y |
| 122 |
$(RM) ascParse.h ascParse.c |
| 123 |
$(SED) -e "/#ifndef YYSTYPE/,/#endif/d" \ |
| 124 |
-e "s/yy/zz_/g" -e "s/YY/ZZ_/g" < y.tab.c > ascParse.c |
| 125 |
$(SED) -e "s/yy/zz_/g" -e "s/YY/ZZ_/g" < y.tab.h > ascParse.h |
| 126 |
$(RM) y.tab.c y.tab.h |
| 127 |
|
| 128 |
|
| 129 |
# rounded needs a special define |
| 130 |
|
| 131 |
rounded.o: $(srcdir)/rounded.h $(srcdir)/rounded.c $(srcdir)/compiler.h |
| 132 |
$(CC) -DSLOPPY $(CC_SWITCHES) -c $(srcdir)/rounded.c |
| 133 |
|
| 134 |
|
| 135 |
# The C file for the scanner (scanner.c) can either be generated by flex, |
| 136 |
# or it can come from a pregenerated C file. The configure script will |
| 137 |
# set the $(MAKE) line under the ``scanner'' target to make either |
| 138 |
# scanner.c.from.flex ---to generate the scanner using flex |
| 139 |
# scanner.c.from.c ---to use the pregenerated C file |
| 140 |
# depending on the value of $(LEX). |
| 141 |
|
| 142 |
scanner.o: $(srcdir)/scanner.l $(srcdir)/scanner.c.no.flex ./ascParse.h |
| 143 |
$(MAKE) @scanner_src@ |
| 144 |
$(CC) $(CC_SWITCHES) -DYY_USE_CONST -c scanner.c |
| 145 |
|
| 146 |
scanner.c.from.flex: $(srcdir)/scanner.l ./ascParse.h |
| 147 |
$(LEX) -Pzz_ -t $(srcdir)/scanner.l > scanner.c |
| 148 |
|
| 149 |
scanner.c.from.c: $(srcdir)/scanner.c.no.flex |
| 150 |
$(CP) $(srcdir)/scanner.c.no.flex scanner.c |
| 151 |
|
| 152 |
scanner.c: $(srcdir)/scanner.l $(srcdir)/scanner.c.no.flex ./ascParse.h |
| 153 |
$(MAKE) @scanner_src@ |
| 154 |
|
| 155 |
|
| 156 |
# This ensures that packages was built with -DNO_PACKAGES |
| 157 |
# when building the stand-alone compiler |
| 158 |
|
| 159 |
.no-packages: packages.o |
| 160 |
$(RM) $? |
| 161 |
$(MAKE) $? HAVE_PACKAGES=-DNO_PACKAGES |
| 162 |
$(ECHO) 'Made packages.o with -DNO_PACKAGES' > $@ |
| 163 |
|
| 164 |
packages.o: $(srcdir)/packages.c |
| 165 |
$(CC) $(HAVE_PACKAGES) $(CC_SWITCHES) -c $(srcdir)/packages.c |
| 166 |
|
| 167 |
|
| 168 |
###==> standalone compiler <==############################## |
| 169 |
# uncomment the following lines if you want to build a standalone |
| 170 |
# compiler with NO_PACKAGES selected in ConfigAscend. |
| 171 |
#HAVE_PACKAGES = -DNO_PACKAGES |
| 172 |
#PACK_LIBS = |
| 173 |
|
| 174 |
|
| 175 |
# Here is a target to build a stand alone version of the ASCEND |
| 176 |
# compiler. It makes sure packages was built with -NO_PACKAGES, |
| 177 |
# and then builds ascend. |
| 178 |
# |
| 179 |
stand-alone: .no-packages |
| 180 |
$(MAKE) ascend PACK_LIBS="" |
| 181 |
|
| 182 |
|
| 183 |
# profiling stuff -- DEC alpha only |
| 184 |
# |
| 185 |
time: |
| 186 |
$(PIXIE) ascend |
| 187 |
cd $(PIXIEDIR); $(builddir)/ascend.pixie ./system |
| 188 |
$(RM) /tmp/time.ascend |
| 189 |
prof $(PIXIE_OPTS) ascend ascend.Addrs \ |
| 190 |
$(PIXIEDIR)/ascend.Counts > /tmp/time.ascend |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
# Files, in addition to the default, to remove when we `make clean' |
| 195 |
|
| 196 |
clean:: |
| 197 |
-$(RM) ascParse.h ascParse.c y.ascParse.c y.ascParse.h yacc.* \ |
| 198 |
scanner.c fascend .no-packages |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
# DO NOT DELETE THIS LINE -- g++dep uses it. |
| 203 |
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. |
| 204 |
|
| 205 |
|
| 206 |
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY |
| 207 |
# |