forked from wrcad/xictools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
189 lines (161 loc) · 5.45 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#######################################################################
LOCATION = adms
#######################################################################
DATE = @DATE@
prefix = @prefix@
itopok = @itopok@
OSNAME = @OSNAME@
INSTALL = @INSTALL@
EXESUFFIX = @EXESUFFIX@
TOOLROOT = @TOOLROOT@
ACONF = @ACONF@
BASE = ../xt_base
INSTALL_BIN = $(INSTALL) -s -c -m 0755
INSTALL_SCRIPT = $(INSTALL) -c -m 0755
INSTALL_LIB = $(INSTALL) -c -m 0644
INSTALL_LIB_RO = $(INSTALL) -c -m 0444
ADMS = ADMS-release-2.3.7.tar.gz
ADMS_DIR = ADMS-release-2.3.7
GIT := \"`git log --pretty=format:'%h' -n 1u`\"
IDSTR := "`./release.sh` `$(BASE)/info.sh osname` `$(BASE)/info.sh arch`"
REGEN = no
all: unpack
@if [ -f adms_wr/admsXml/Makefile ]; then \
cd adms_wr/admsXml; $(MAKE); \
else \
echo "ADMS configuration failed. cleaning..."; \
rm -rf adms_wr; \
fi
unpack:
@if [ ! -d adms_wr ]; then \
tar xzf $(ADMS); \
mv -f $(ADMS_DIR) adms_wr; \
sed -e s/VERSION/$$(./release.sh)/ < files/configure.in.sed \
> adms_wr/configure.in; \
sed -e s/GIT/$(GIT)/ -e s/XT_IDSTRING/$(IDSTR)/ \
< files/admsXml.c.sed > adms_wr/admsXml/admsXml.c; \
mv -f adms_wr/configure.ac adms_wr/configure.ac.notused; \
cp -f files/install-sh adms_wr/auxconf; \
cp -f files/Makefile.in adms_wr/admsXml; \
cp -f files/config.h.in adms_wr/admsXml; \
cp -f files/constants.vams adms_wr/admsXml; \
cp -f files/disciplines.vams adms_wr/admsXml; \
cp -f files/admsPreprocessor.h adms_wr/admsXml; \
cp -f files/mkelements.pl adms_wr/admsXml; \
cp -f files/admsPreprocessor.h adms_wr/admsXml; \
cp -f files/admsVeriloga.h adms_wr/admsXml; \
cp -f files/verilogaYacc.y.in adms_wr/admsXml; \
if [ $(REGEN) = yes ]; then \
cd adms_wr; $(ACONF); ./configure --enable-maint=yes; \
else \
cp -f generated/*.c generated/*.h adms_wr/admsXml; \
cd adms_wr; $(ACONF); ./configure --enable-maint=no; \
fi; \
fi
clean:
-@if [ -d adms_wr ]; then \
cd adms_wr/admsXml; $(MAKE) $@; \
fi
distclean:
-@rm -rf adms_wr Makefile
-@cd packages; $(MAKE) $@
depend: unpack
#######################################################################
####### Installation ##################################################
INSTALL_PREFIX ?= $(prefix)
dst_lib = $(INSTALL_PREFIX)/$(TOOLROOT)/adms
dst_bin = $(INSTALL_PREFIX)/$(TOOLROOT)/bin
src = adms_wr/admsXml
install: install_test install_force
install_force: uninstall_clean install_bin install_lib
install_bin: $(dst_bin)
install_lib: $(dst_lib) $(dst_lib)/doc $(dst_lib)/examples
install_test::
@if [ $(INSTALL_PREFIX) = $(prefix) ]; then \
if [ $(itopok) != yes ]; then \
echo "No! Use pagkage to install!"; \
exit 1; \
fi; \
fi
$(dst_bin)::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_BIN) $(src)/admsXml$(EXESUFFIX) $@
$(dst_lib)::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_LIB) README $@
$(dst_lib)/doc::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_LIB) doc/README $@
@$(BASE)/util/mkdirpth $@/man
@$(INSTALL_LIB) $(src)/admsXml.1 $@/man
@$(BASE)/util/mkdirpth $@/xml
@files=`packages/util/adms_files xml`; \
for a in $$files; do \
$(INSTALL_LIB) adms_wr/$$a $@/xml; \
done
@$(BASE)/util/mkdirpth $@/html
@files=`packages/util/adms_files html`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/$$a $@/html; \
done
@$(BASE)/util/mkdirpth $@/html/doc
@files=`packages/util/adms_files html_doc`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/doc/$$a $@/html/doc; \
done
@$(BASE)/util/mkdirpth $@/html/introduction
@files=`packages/util/adms_files html_intro`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/introduction/$$a $@/html/introduction; \
done
@$(BASE)/util/mkdirpth $@/html/scripts
@files=`packages/util/adms_files html_scripts`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/scripts/$$a $@/html/scripts; \
done
@$(BASE)/util/mkdirpth $@/html/tutorials
@files=`packages/util/adms_files html_tutorials`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/tutorials/$$a $@/html/tutorials; \
done
@$(BASE)/util/mkdirpth $@/html/tutorials/Ilya-Lisichkin/MOSlevel1
@files=`packages/util/adms_files tmos`; \
for a in $$files; do \
$(INSTALL_LIB) doc/html/tutorials/Ilya-Lisichkin/MOSlevel1/$$a \
$@/html/tutorials/Ilya-Lisichkin/MOSlevel1; \
done
$(INSTALL_LIB) \
"doc/html/tutorials/Ilya-Lisichkin/MOSlevel1/MOS1 into ZSPICE.html" \
$@/html/tutorials/Ilya-Lisichkin/MOSlevel1
$(dst_lib)/examples::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_BIN) $(src)/admsCheck$(EXESUFFIX) $@
@$(INSTALL_LIB) $(src)/admsCheck.1 $@
@$(BASE)/util/mkdirpth $@/scripts
@files=`packages/util/adms_files scripts`; \
for a in $$files; do \
$(INSTALL_LIB) adms_wr/scripts/$$a $@/scripts; \
done
@$(BASE)/util/mkdirpth $@/testcases
@files=`packages/util/adms_files testcases`; \
for a in $$files; do \
$(INSTALL_LIB) adms_wr/testcases/$$a $@/testcases; \
done
uninstall: uninstall_test uninstall_clean
uninstall_test::
@if [ $(INSTALL_PREFIX) = $(prefix) ]; then \
if [ $(itopok) != yes ]; then \
echo "No! Use operating system or wr_uninstall script to uninstall!"; \
exit 1; \
fi; \
fi
uninstall_clean::
-@rm -f $(dst_bin)/admsXml$(EXESUFFIX)
-@rm -rf $(dst_lib)
package::
$(MAKE)
-rm -rf packages/root
mkdir packages/root
$(MAKE) INSTALL_PREFIX=packages/root$(prefix) install
cd packages; $(MAKE) package
#######################################################################