File: Makefile_dist

package info (click to toggle)
ats2-lang 0.3.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,116 kB
  • sloc: ansic: 389,606; makefile: 7,069; lisp: 770; sh: 657; php: 573; python: 387; perl: 365
file content (244 lines) | stat: -rw-r--r-- 5,012 bytes parent folder | download
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
######
#
# HX-2013-03:
# for compiling a distribution of ATS-Postiats
# KO-2014-04-09:
# removing [-T] from [install] as the option is
# not supported on MacOS
# IU-2014-04-30:
# removing the space between -m and the following mode
# as it is not supported on freeBSD
#
######

CPF=cp -f
CPR=cp -R
MVF=mv -f
RMF=rm -f
RMRF=rm -rf

######

MAKE=make
MAKEJ4=make

######
#
all:: config.mk
#
all:: bin2_patsopt
all:: lib2_libatsopt
#
all:: bin_patscc
all:: bin_myatscc
#
all:: ccomp/atslib/lib/libatslib.a
#
######

configure: ; /bin/bash autogen.sh

######
#
# HX: this seems to be working
#
# config.mk : configure ; ./configure
#
#######
#
config.mk: \
configure ; \
@echo "Please execute './configure'." ; exit 1 ;
#
######

src_patsopt: ; $(MAKE) -C src patsopt
bin_patsopt: src_patsopt ; $(CPF) src/patsopt bin/patsopt

######
#
CCOMP=gcc
#
GCFLAG=
#GCFLAG=-D_ATS_NGC
#GCFLAG=-D_ATS_GCBDW
#GCFLAG=-D_ATS_GCATS
#
CFLAGS=
LDFLAGS=
#
######
#
src2_patsopt: ; \
$(MAKEJ4) -C src/CBOOT patsopt \
CCOMP=$(CCOMP) GCFLAG=$(GCFLAG) LDFLAGS=$(LDFLAGS) 
#
bin2_patsopt: src2_patsopt ; $(CPF) src/CBOOT/patsopt bin/patsopt
#
######

utl_atscc: ; \
$(MAKE) -C utils/atscc copy build clean
bin_patscc: utl_atscc ; \
$(MVF) utils/atscc/BUILD/patscc bin/patscc

######

utl_myatscc: ; \
$(MAKE) -C utils/myatscc copy build clean
bin_myatscc: utl_myatscc ; \
$(MVF) utils/myatscc/BUILD/myatscc bin/myatscc

######
#
src2_libatsopt: ; \
$(MAKE) -C src/CBOOT CCOMP=$(CCOMP) libatsopt
lib2_libatsopt: src2_libatsopt ; \
$(CPF) src/CBOOT/libatsopt.a ccomp/atslib/lib/.
#
######

ccomp/atslib/lib/libatslib.a: ; $(MAKE) -C ccomp/atslib atslib

######

-include config.mk

######
#
# This variable is to be set externally
#
DESTDIR :=
#
######

export PATSHOME
export PATSLIBHOME

######

bindir2 := $(DESTDIR)$(bindir)
PATSLIBHOME2 := $(DESTDIR)$(PATSLIBHOME)

######
#
# HX-2011-06-01:
# This part was originally written by Georg Bauhaus
# (bauhausATarcorDOTde): It addresses the issue that
# the [-D] option is not available for $(INSTALL) on MacOSX.
#
.PHONY: install_dirs
.PHONY: install_files
#
install: install_files

install_files: \
  install_files_00 \
  install_files_10 \
  install_files_11 \
  install_files_20 \
  install_files_30 \
  install_files_31 \
  install_files_40 \
  install_files_50 \

install_dirs: ; \
  cd "$(abs_top_srcdir)" && \
  $(MKDIR_P) $(PATSLIBHOME2)/bin && \
  if [ ! -d $(bindir2) ] ; then $(MKDIR_P) $(bindir2) ; fi && \
  for x in share ccomp prelude libats contrib ; do \
    find "$$x" -type d -exec $(MKDIR_P) $(PATSLIBHOME2)/\{} \; -print; \
  done

install_files_00: install_dirs ; \
  for x in share ccomp/runtime prelude libats contrib ; do \
    cd "$(abs_top_srcdir)" && \
    $(INSTALL) -d $(PATSLIBHOME2)/"$$x" && \
    find "$$x" -type l -exec $(CPR) \{} $(PATSLIBHOME2)/\{} \; -print && \
    find "$$x" -type f -exec $(INSTALL) -m644 \{} $(PATSLIBHOME2)/\{} \; -print; \
  done

install_files_10: bin/patscc ; \
  $(INSTALL) -m755 $< $(PATSLIBHOME2)/bin/patscc && echo $<
install_files_11: bin/myatscc ; \
  $(INSTALL) -m755 $< $(PATSLIBHOME2)/bin/myatscc && echo $<
install_files_20: bin/patsopt ; \
  $(INSTALL) -m755 $< $(PATSLIBHOME2)/bin/patsopt && echo $<
install_files_30: bin/patscc_env.sh ; \
  $(INSTALL) -m755 $< $(bindir2)/patscc && echo $<
install_files_31: bin/myatscc_env.sh ; \
  $(INSTALL) -m755 $< $(bindir2)/myatscc && echo $<
install_files_40: bin/patsopt_env.sh ; \
  $(INSTALL) -m755 $< $(bindir2)/patsopt && echo $<

install_files_50: ; \
  for x in \
    ccomp/atslib/lib/libatslib.a \
    ccomp/atslib/lib64/libatslib.a ; \
  do \
    if [ -e "$$x" ] ; then \
      $(INSTALL) -m755 "$$x" $(PATSLIBHOME2)/"$$x" && echo "$$x"; \
    fi; \
  done

######
#
# HX-2017-11-11:
# Please execute the following
# command-lines before reinstall
#
# make -C ccomp/atslib clean
# make -C ccomp/atslib atslib
#
reinstall_atslib: install_files_50  
#
######
#
uninstall:: uninstall_bin
uninstall:: uninstall_home
#
uninstall_bin:: ; $(RMF) $(bindir2)/patscc
uninstall_bin:: ; $(RMF) $(bindir2)/myatscc
uninstall_bin:: ; $(RMF) $(bindir2)/patsopt
uninstall_home:: ; $(RMRF) $(PATSLIBHOME2)
#
######

clean::
cleanall:: clean

######

clean:: ; $(RMF) ccomp/atslib/output/*.o
clean:: ; $(MAKE) -C src/CBOOT -f Makefile clean

######

cleanall:: ; $(RMF) stamp-h1
cleanall:: ; $(RMF) config.mk
cleanall:: ; $(RMF) config.log
cleanall:: ; $(RMF) config.status
cleanall:: ; $(RMRF) autom4te.cache

cleanall:: ; $(RMF) bin/patscc
cleanall:: ; $(RMF) bin/myatscc
cleanall:: ; $(RMF) bin/patsopt
cleanall:: ; $(RMF) bin/patscc_env.sh
cleanall:: ; $(RMF) bin/myatscc_env.sh
cleanall:: ; $(RMF) bin/patsopt_env.sh

cleanall:: ; $(RMF) ccomp/atslib/lib/*
cleanall:: ; $(RMF) ccomp/atslib/lib64/*
cleanall:: ; $(RMF) ccomp/atslib/output/*

cleanall:: ; $(MAKE) -C src -f Makefile cleanall
cleanall:: ; $(MAKE) -C src/CBOOT -f Makefile cleanall
cleanall:: ; $(MAKE) -C utils/atscc -f Makefile cleanall

######

distclean:: cleanall

######

###### end of [Makefile_dist] ######