Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / cns / Makefile
1 #
2 # This file is part of the Alliance CAD System
3 # Copyright (C) Laboratoire LIP6 - Département ASIM
4 # Universite Pierre et Marie Curie
5 #
6 # Home page : http://www-asim.lip6.fr/alliance/
7 # E-mail support : mailto:alliance-support@asim.lip6.fr
8 #
9 # This progam is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 2 of the License, or (at your
12 # option) any later version.
13 #
14 # Alliance VLSI CAD System is distributed in the hope that it will be
15 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 # Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License along
20 # with the GNU C Library; see the file COPYING. If not, write to the Free
21 # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #
23
24 # 10/23/97 Makefile for cns
25
26 include $(AVERTEC_TOP)/etc/$(AVERTEC_OS).mk
27 include $(AVERTEC_TOP)/etc/libraries.mk
28 include $(AVERTEC_TOP)/etc/Avertec.mk
29
30 SHELL = /bin/sh
31
32 CNSh = cnsi.h cns.h cnsd.h cnsv.h cnsh.h
33
34 CNSsce = cnsv.c cnsenv.c cnsptype.c cnslocon.c cnslotrs.c link.c branch.c edge.c inoutcone.c cone.c coneexpr.c cell.c cnsfig.c cnsfigprs.c cnsfigdrv.c cnsstats.c cns_utils.c
35
36 CNSallh = cnsall.h
37
38 CNSobj = $(CNSsce:.c=.o)
39
40 PARSEh = parser/prsh.h
41
42 PARSEsce = parser/prsutil.c parser/cnsfig.yac parser/cnsfig.lex
43
44 PARSEallh = parser/prsall.h
45
46 PARSEobj = parser/prsutil.o parser/cnsfigy.tab.o parser/cnsfiglex.yy.o
47
48 CNSDIFF_BIN = cnsdiff
49
50 CNS_INC = cns_lib.h
51
52 LOCAL_INC = -I$(TARGET_INCLUDE)
53
54 LOCAL_CFLAGS = $(CFLAGS)
55 LOCAL_CPPFLAGS = $(CPPFLAGS) -c $(LOCAL_INC) \
56 -D$(AVERTEC_LICENSE) \
57 -D$(AVERTEC_OS) \
58 -DAVT_H='<$(AVT_H)>' \
59 -DMUT_H='<$(MUT_H)>' \
60 -DMLO_H='<$(MLO_H)>' \
61 -DMLU_H='<$(MLU_H)>' \
62 -DEQT_H='<$(EQT_H)>' \
63 -DRCN_H='<$(RCN_H)>' \
64 -DBEG_H='<$(BEG_H)>' \
65 -DBEH_H='<$(BEH_H)>' \
66 -DCBH_H='<$(CBH_H)>' \
67 -DINF_H='<$(INF_H)>' \
68 -DLOG_H='<$(LOG_H)>'
69
70 LOCAL_YACCFLAGS = $(YACCFLAGS) -d -t
71
72 LOCAL_LEXFLAGS = $(LEXFLAGS)
73
74 all : $(TARGET_INCLUDE)/$(CNS_H) $(TARGET_LIB)/$(CNS_LIB)
75
76 bin : $(TARGET_BIN)/$(CNSDIFF_BIN)
77
78 headers : $(TARGET_INCLUDE)/$(CNS_H)
79
80 .c.o :
81 $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -o $@ $<
82
83 $(TARGET_BIN)/$(CNSDIFF_BIN):
84 @cd cnsdiff ; $(MAKE) -f Makefile
85
86 $(TARGET_INCLUDE)/$(CNS_H) : $(CNSh)
87 echo "/* file : $(CNS_INC)" > $(TARGET_INCLUDE)/$(CNS_H)
88 echo " | date : `date`" >> $(TARGET_INCLUDE)/$(CNS_H)
89 echo " | author : Pascal REMY & Anthony LESTER" >> $(TARGET_INCLUDE)/$(CNS_H)
90 echo " | content: #includes, #defines, structures and variables for the CNS library */" >> $(TARGET_INCLUDE)/$(CNS_H)
91 echo "" >> $(TARGET_INCLUDE)/$(CNS_H)
92 echo "#ifndef CNS" >> $(TARGET_INCLUDE)/$(CNS_H)
93 echo "#define CNS" >> $(TARGET_INCLUDE)/$(CNS_H)
94 echo "" >> $(TARGET_INCLUDE)/$(CNS_H)
95 echo "" >> $(TARGET_INCLUDE)/$(CNS_H)
96 $(CAT) $(CNSh) | expand -3 >> $(TARGET_INCLUDE)/$(CNS_H)
97 echo "#endif" >> $(TARGET_INCLUDE)/$(CNS_H)
98 @if [ -f y.output ] ; then $(RM) y.output ; fi
99
100 $(TARGET_LIB)/$(CNS_LIB) : $(CNSobj) $(PARSEh) $(PARSEobj)
101 $(AR) $(ARFLAGS) $(TARGET_LIB)/$(CNS_LIB) $(CNSobj) $(PARSEobj)
102 $(RANLIB) $(TARGET_LIB)/$(CNS_LIB)
103 @if [ -f y.output ] ; then $(RM) y.output ; fi
104
105 $(CNSobj): $(CNSh) $(CNSallh)
106
107 parser/prsutil.o : $(CNSh) $(PARSEh) parser/prsutil.c
108 $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -o parser/prsutil.o parser/prsutil.c
109
110 parser/cnsfigy.tab.o : $(CNSh) $(PARSEh) parser/cnsfig.yac
111 $(YACC) $(LOCAL_YACCFLAGS) parser/cnsfig.yac
112 echo "s/yy/cnsfigyy/g" > parser/tmpy
113 echo "s/YY/cnsfigYY/g" >> parser/tmpy
114 $(SED) -f parser/tmpy y.tab.c > parser/cnsfigy.tab.c
115 $(SED) -f parser/tmpy y.tab.h > parser/cnsfigy.tab.h
116 $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -o parser/cnsfigy.tab.o parser/cnsfigy.tab.c
117 $(RM) y.tab.h y.tab.c
118
119 parser/cnsfiglex.yy.o : parser/cnsfig.lex parser/cnsfigy.tab.o
120 $(LEX) $(LOCAL_LEXFLAGS) parser/cnsfig.lex
121 echo "s/yy/cnsfigyy/g" > parser/tmpl
122 echo "s/YY/cnsfigYY/g" >> parser/tmpl
123 echo "s/y\.tab\.h/cnsfigy.tab.h/g" >> parser/tmpl
124 $(SED) -f parser/tmpl lex.yy.c > parser/cnsfiglex.yy.c
125 $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -o parser/cnsfiglex.yy.o parser/cnsfiglex.yy.c
126 $(RM) lex.yy.c
127
128 realclean : clean
129 $(RM) -f $(TARGET_LIB)/$(CNS_LIB) \
130 $(TARGET_INCLUDE)/$(CNS_H)
131 @cd cnsdiff ; $(MAKE) -f Makefile realclean
132
133 clean :
134 $(RM) -f $(CNSobj) $(PARSEobj) \
135 parser/cnsfigy.tab.c parser/cnsfigy.tab.h parser/tmp \
136 parser/cnsfiglex.yy.c parser/tmpl parser/tmpy
137 @cd cnsdiff ; $(MAKE) -f Makefile clean