forked from wrcad/xictools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
153 lines (128 loc) · 4.5 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
#######################################################################
LOCATION = fasthenry
#######################################################################
DATE = @DATE@
prefix = @prefix@
itopok = @itopok@
CC = @CC@
OSNAME = @OSNAME@
INSTALL = @INSTALL@
EXESUFFIX = @EXESUFFIX@
TOOLROOT = @TOOLROOT@
LIBRT = @LIBRT@
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
FASTHENRY = fasthenry-3.0wr-113020.tar.gz
FASTHENRY_DIR = fasthenry-3.0wr
SRCDIR = $(FASTHENRY_DIR)/src/fasthenry
IDSTR := \"`./version` `$(BASE)/info.sh osname` `$(BASE)/info.sh arch`\"
VERS := \"`./version`\"
all: unpack
# Make the KLU version since it is faster.
if [ ! -f ../KLU/KLU/Lib/libklu.a ]; then \
cd ../KLU; $(MAKE); \
fi
cd $(FASTHENRY_DIR); $(MAKE) SOLVER=KLU_SOLVER CC="$(CC)" all
unpack:
@if [ ! -d $(FASTHENRY_DIR) ]; then \
tar xzf $(FASTHENRY); \
if [ -n "$(EXESUFFIX)" ]; then \
(cd $(FASTHENRY_DIR); ./config mingw); \
fi; \
mv -f $(SRCDIR)/release.h $(SRCDIR)/release.h.orig; \
sed -e "s/FHVERSION .*$$/FHVERSION $(VERS)/" \
-e "s/FHDATE .*$$/FHDATE \"xictools\"/" \
-e "s/ID_STRING .*$$/ID_STRING $(IDSTR)/" \
< $(SRCDIR)/release.h.orig > $(SRCDIR)/release.h; \
mv -f $(SRCDIR)/mk_klu.inc $(SRCDIR)/mk_klu.inc.orig; \
sed -e "s^KLU_HOME .*$$^KLU_HOME = ../../../../KLU^" \
-e "s^#RTLIB .*$$^RTLIB = $(LIBRT)^" \
< $(SRCDIR)/mk_klu.inc.orig > $(SRCDIR)/mk_klu.inc; \
fi
clean:
-@if [ -d $(FASTHENRY_DIR) ]; then \
cd $(FASTHENRY_DIR); $(MAKE) $@; \
fi
distclean:
-@rm -rf $(FASTHENRY_DIR) Makefile
-@cd packages; $(MAKE) $@
depend:
#######################################################################
####### Installation ##################################################
INSTALL_PREFIX ?= $(prefix)
dst_lib = $(INSTALL_PREFIX)/$(TOOLROOT)/fasthenry
dst_bin = $(INSTALL_PREFIX)/$(TOOLROOT)/bin
install: install_test install_force
install_force: install_clean install_bin install_lib install_examples
install_bin: $(dst_bin)
install_lib: $(dst_lib) $(dst_lib)/doc
install_examples: $(dst_lib)/examples
install_test::
@if [ $(INSTALL_PREFIX) = $(prefix) ]; then \
if [ $(itopok) != yes ]; then \
echo "No! Use pagkage to install!"; \
exit 1; \
fi; \
fi
install_clean::
-@execs=`packages/util/fh_files bin`; \
for aa in $$execs; do \
rm -f $(dst_bin)/$$aa$(EXESUFFIX); \
done
rm -rf $(dst_lib)
$(dst_bin)::
@$(BASE)/util/mkdirpth $@
@execs=`packages/util/fh_files bin`; \
for aa in $$execs; do \
$(INSTALL_BIN) $(FASTHENRY_DIR)/bin/$$aa$(EXESUFFIX) $@; \
done
$(dst_lib)::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_LIB) $(FASTHENRY_DIR)/README $@
@$(INSTALL_LIB) $(FASTHENRY_DIR)/README.mit $@
$(dst_lib)/doc::
@$(BASE)/util/mkdirpth $@
@docs=`packages/util/fh_files doc`; \
for aa in $$docs; do \
$(INSTALL_LIB) $(FASTHENRY_DIR)/doc/$$aa $@; \
done
# 090919 framework
$(dst_lib)/examples::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_SCRIPT) $(FASTHENRY_DIR)/examples/cf $@
@$(INSTALL_SCRIPT) $(FASTHENRY_DIR)/examples/run $@
@$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/README $@
@$(BASE)/util/mkdirpth $@/input
@files=`packages/util/fh_files examples_input`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/input/$$aa $@/input; \
done
@$(BASE)/util/mkdirpth $@/results
@$(BASE)/util/mkdirpth $@/results/linux_dss
@files=`packages/util/fh_files examples_results`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/results/linux_dss/$$aa $@/results/linux_dss; \
done
@$(BASE)/util/mkdirpth $@/results/linux_klu
@files=`packages/util/fh_files examples_results`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/results/linux_klu/$$aa $@/results/linux_klu; \
done
@$(BASE)/util/mkdirpth $@/results/linux_sparse
@files=`packages/util/fh_files examples_results`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/results/linux_sparse/$$aa $@/results/linux_sparse; \
done
@$(BASE)/util/mkdirpth $@/torture
@$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/torture/README $@/torture
@$(INSTALL_LIB) $(FASTHENRY_DIR)/examples/torture/bfh.inp $@/torture
package::
$(MAKE) all
-rm -rf packages/root
mkdir packages/root
$(MAKE) INSTALL_PREFIX=packages/root$(prefix) install
cd packages; $(MAKE) package
#######################################################################