-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathMakefile.in
147 lines (120 loc) · 3.81 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
#######################################################################
LOCATION = fastcap
#######################################################################
DATE = @DATE@
prefix = @prefix@
itopok = @itopok@
OSNAME = @OSNAME@
INSTALL = @INSTALL@
EXESUFFIX = @EXESUFFIX@
TOOLROOT = @TOOLROOT@
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
FASTCAP = fastcap-2.0wr-072020.tar.gz
FASTCAP_DIR = fastcap-2.0wr
SRCDIR = $(FASTCAP_DIR)/src
IDSTR := \"`./version` `$(BASE)/info.sh osname` `$(BASE)/info.sh arch`\"
VERS := \"`./version` (xictools)\"
all: unpack
cd $(FASTCAP_DIR); $(MAKE) all
cd fc_accs; $(MAKE) all
unpack:
@if [ ! -d $(FASTCAP_DIR) ]; then \
tar xzf $(FASTCAP); \
if [ -n "$(EXESUFFIX)" ]; then \
(cd $(FASTCAP_DIR); ./config mingw); \
fi; \
mv -f $(SRCDIR)/release.h $(SRCDIR)/release.h.orig; \
sed -e "s/FCVERSION .*$$/FCVERSION $(VERS)/" \
-e "s/ID_STRING .*$$/ID_STRING $(IDSTR)/" \
< $(SRCDIR)/release.h.orig > $(SRCDIR)/release.h; \
fi
clean:
-@if [ -d $(FASTCAP_DIR) ]; then \
cd $(FASTCAP_DIR); $(MAKE) $@; \
fi
-@cd fc_accs; $(MAKE) $@
distclean:
-@rm -rf $(FASTCAP_DIR) Makefile
-@cd fc_accs; $(MAKE) $@
-@cd packages; $(MAKE) $@
depend:
@cd fc_accs; $(MAKE) $@
#######################################################################
####### Installation ##################################################
INSTALL_PREFIX ?= $(prefix)
dst_lib = $(INSTALL_PREFIX)/$(TOOLROOT)/fastcap
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 $(dst_lib)/examples/work \
$(dst_lib)/examples/work/results
install_test::
@if [ $(INSTALL_PREFIX) = $(prefix) ]; then \
if [ $(itopok) != yes ]; then \
echo "No! Use pagkage to install!"; \
exit 1; \
fi; \
fi
install_clean::
-@accs=`packages/util/fc_files accs`; \
for aa in $$accs; do \
rm -f $(dst_bin)/$$aa$(EXESUFFIX); \
done
-@execs=`packages/util/fc_files bin`; \
for aa in $$execs; do \
rm -f $(dst_bin)/$$aa$(EXESUFFIX); \
done
rm -rf $(dst_lib)
$(dst_bin)::
@$(BASE)/util/mkdirpth $@
@accs=`packages/util/fc_files accs`; \
for aa in $$accs; do \
$(INSTALL_BIN) fc_accs/$$aa$(EXESUFFIX) $@; \
done
@execs=`packages/util/fc_files bin`; \
for aa in $$execs; do \
$(INSTALL_BIN) $(FASTCAP_DIR)/bin/$$aa$(EXESUFFIX) $@; \
done
$(dst_lib)::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_LIB) $(FASTCAP_DIR)/README $@
@$(INSTALL_LIB) $(FASTCAP_DIR)/README.mit $@
$(dst_lib)/doc::
@$(BASE)/util/mkdirpth $@
@docs=`packages/util/fc_files doc`; \
for aa in $$docs; do \
$(INSTALL_LIB) $(FASTCAP_DIR)/doc/$$aa $@; \
done
$(dst_lib)/examples::
@$(BASE)/util/mkdirpth $@
@files=`packages/util/fc_files examples`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTCAP_DIR)/examples/$$aa $@; \
done
@scripts=`packages/util/fc_files examples_scripts`; \
for aa in $$scripts; do \
$(INSTALL_SCRIPT) $(FASTCAP_DIR)/examples/$$aa $@; \
done
$(dst_lib)/examples/work::
@$(BASE)/util/mkdirpth $@
@$(INSTALL_LIB) $(FASTCAP_DIR)/examples/work/Makefile $@
@$(INSTALL_SCRIPT) $(FASTCAP_DIR)/examples/work/run $@
$(dst_lib)/examples/work/results::
@$(BASE)/util/mkdirpth $@
@files=`packages/util/fc_files results`; \
for aa in $$files; do \
$(INSTALL_LIB) $(FASTCAP_DIR)/examples/work/results/$$aa $@; \
done
package::
$(MAKE) all
-rm -rf packages/root
mkdir packages/root
$(MAKE) INSTALL_PREFIX=packages/root$(prefix) install
cd packages; $(MAKE) package
#######################################################################