File: Makefile_dist

package info (click to toggle)
ats2-lang 0.1.3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 28,136 kB
  • ctags: 20,441
  • sloc: ansic: 354,696; makefile: 2,679; sh: 638
file content (176 lines) | stat: -rw-r--r-- 3,700 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
######
#
# 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
#
######
#
all: \
  config.mk \
  bin2_patsopt \
  bin_patscc \
  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 -j4 -C src patsopt
bin_patsopt: src_patsopt ; cp -f src/patsopt bin/patsopt

######
#
CCOMP=gcc
GCFLAG=-D_ATS_GCATS
CFLAGS=
LDFLAGS=
#
src2_patsopt: ; \
make -j4 -C src/CBOOT \
  CCOMP=$(CCOMP) GCFLAG=$(GCFLAG) \
  CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) patsopt
#
bin2_patsopt: src2_patsopt ; cp -f src/CBOOT/patsopt bin/patsopt
#
######

utl_atscc: ; make -C utils/atscc patscc
bin_patscc: utl_atscc ; cp -f utils/atscc/patscc bin/patscc

######

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 writtend by Georg Bauhaus
# (bauhaus AT arcor DOT de): 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_0 \
  install_files_1 \
  install_files_2 \
  install_files_3 \
  install_files_4 \
  install_files_5 \

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

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

install_files_1: bin/patscc ; \
  $(INSTALL) -m755 $< $(PATSLIBHOME2)/bin/patscc && echo $<
install_files_2: bin/patsopt ; \
  $(INSTALL) -m755 $< $(PATSLIBHOME2)/bin/patsopt && echo $<
install_files_3: bin/patscc_env.sh ; \
  $(INSTALL) -m755 $< $(bindir2)/patscc && echo $<
install_files_4: bin/patsopt_env.sh ; \
  $(INSTALL) -m755 $< $(bindir2)/patsopt && echo $<

install_files_5: ; \
  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

######

RMF=rm -f
RMRF=rm -rf

######

clean::

######

cleanall:: clean

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

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

cleanall:: ; make -C src -f Makefile cleanall
cleanall:: ; make -C src/CBOOT -f Makefile cleanall
cleanall:: ; make -C utils/atscc -f Makefile cleanall

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

######

distclean:: cleanall

######

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