1 | ######################## -*- Mode: Makefile-Automake -*- ###################### |
---|
2 | ## |
---|
3 | ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
4 | ## |
---|
5 | ## The contents of this file are covered under the licence agreement in the |
---|
6 | ## file "LICENCE" distributed with Cforall. |
---|
7 | ## |
---|
8 | ## Makefile.am -- |
---|
9 | ## |
---|
10 | ## Author : Peter A. Buhr |
---|
11 | ## Created On : Sun May 31 08:54:01 2015 |
---|
12 | ## Last Modified By : Peter A. Buhr |
---|
13 | ## Last Modified On : Wed Aug 30 21:22:45 2023 |
---|
14 | ## Update Count : 263 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | # create object files in directory with source files |
---|
18 | AUTOMAKE_OPTIONS = foreign subdir-objects |
---|
19 | ACLOCAL_AMFLAGS = -I automake |
---|
20 | |
---|
21 | include $(top_srcdir)/../tools/build/cfa.make |
---|
22 | |
---|
23 | libdir = ${CFA_LIBDIR} |
---|
24 | lib_LTLIBRARIES = libcfa.la libcfathread.la |
---|
25 | |
---|
26 | VPATH += :../prelude |
---|
27 | |
---|
28 | gdbwaittarget="" |
---|
29 | |
---|
30 | # AM_CFLAGS for all cfa source |
---|
31 | # AM_CFAFLAGS for only cfa source |
---|
32 | # use -no-include-stdhdr to prevent rebuild cycles |
---|
33 | # The built sources must not depend on the installed inst_headers_src |
---|
34 | AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr -I$(srcdir)/concurrency $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ |
---|
35 | AM_CFLAGS = -g -Wall -Werror=return-type -Wno-unused-function -fPIC -fexceptions -fvisibility=hidden -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
36 | AM_CCASFLAGS = -g -Wall -Werror=return-type -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
37 | CFACC = @CFACC@ |
---|
38 | |
---|
39 | #---------------------------------------------------------------------------------------------------------------- |
---|
40 | if BUILDLIB |
---|
41 | inst_headers_nosrc = \ |
---|
42 | Exception.hfa \ |
---|
43 | bitmanip.hfa \ |
---|
44 | clock.hfa \ |
---|
45 | exception.hfa \ |
---|
46 | exception.h \ |
---|
47 | gmp.hfa \ |
---|
48 | math.trait.hfa \ |
---|
49 | math.hfa \ |
---|
50 | time_t.hfa \ |
---|
51 | virtual_dtor.hfa \ |
---|
52 | bits/algorithm.hfa \ |
---|
53 | bits/align.hfa \ |
---|
54 | bits/collections.hfa \ |
---|
55 | bits/debug.hfa \ |
---|
56 | bits/defs.hfa \ |
---|
57 | bits/locks.hfa \ |
---|
58 | bits/collection.hfa \ |
---|
59 | bits/stack.hfa \ |
---|
60 | bits/queue.hfa \ |
---|
61 | bits/sequence.hfa \ |
---|
62 | concurrency/atomic.hfa \ |
---|
63 | concurrency/iofwd.hfa \ |
---|
64 | concurrency/barrier.hfa \ |
---|
65 | collections/array.hfa \ |
---|
66 | collections/list.hfa \ |
---|
67 | collections/lockfree.hfa \ |
---|
68 | collections/string_sharectx.hfa \ |
---|
69 | collections/vector2.hfa \ |
---|
70 | vec/vec.hfa \ |
---|
71 | vec/vec2.hfa \ |
---|
72 | vec/vec3.hfa \ |
---|
73 | vec/vec4.hfa |
---|
74 | |
---|
75 | inst_headers_src = \ |
---|
76 | common.hfa \ |
---|
77 | fstream.hfa \ |
---|
78 | heap.hfa \ |
---|
79 | iostream.hfa \ |
---|
80 | iterator.hfa \ |
---|
81 | limits.hfa \ |
---|
82 | memory.hfa \ |
---|
83 | parseargs.hfa \ |
---|
84 | parseconfig.hfa \ |
---|
85 | rational.hfa \ |
---|
86 | stdlib.hfa \ |
---|
87 | strstream.hfa \ |
---|
88 | time.hfa \ |
---|
89 | bits/weakso_locks.hfa \ |
---|
90 | algorithms/range_iterator.hfa \ |
---|
91 | collections/maybe.hfa \ |
---|
92 | collections/pair.hfa \ |
---|
93 | collections/result.hfa \ |
---|
94 | collections/string.hfa \ |
---|
95 | collections/string_res.hfa \ |
---|
96 | collections/vector.hfa \ |
---|
97 | device/cpu.hfa |
---|
98 | |
---|
99 | libsrc = ${inst_headers_src} ${inst_headers_src:.hfa=.cfa} \ |
---|
100 | assert.cfa \ |
---|
101 | bits/debug.cfa \ |
---|
102 | exception.c \ |
---|
103 | interpose.cfa \ |
---|
104 | lsda.h \ |
---|
105 | startup.cfa \ |
---|
106 | startup.hfa \ |
---|
107 | virtual.c \ |
---|
108 | virtual.h |
---|
109 | |
---|
110 | # not all platforms support concurrency, add option do disable it |
---|
111 | inst_thread_headers_nosrc = \ |
---|
112 | bits/random.hfa \ |
---|
113 | concurrency/clib/cfathread.h \ |
---|
114 | concurrency/invoke.h \ |
---|
115 | concurrency/future.hfa \ |
---|
116 | concurrency/once.hfa \ |
---|
117 | concurrency/kernel/fwd.hfa \ |
---|
118 | concurrency/mutex_stmt.hfa \ |
---|
119 | concurrency/channel.hfa \ |
---|
120 | concurrency/actor.hfa \ |
---|
121 | concurrency/cofor.hfa |
---|
122 | |
---|
123 | inst_thread_headers_src = \ |
---|
124 | concurrency/alarm.hfa \ |
---|
125 | concurrency/coroutine.hfa \ |
---|
126 | concurrency/exception.hfa \ |
---|
127 | concurrency/kernel.hfa \ |
---|
128 | concurrency/kernel/cluster.hfa \ |
---|
129 | concurrency/locks.hfa \ |
---|
130 | concurrency/monitor.hfa \ |
---|
131 | concurrency/mutex.hfa \ |
---|
132 | concurrency/select.hfa \ |
---|
133 | concurrency/thread.hfa |
---|
134 | |
---|
135 | thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \ |
---|
136 | interpose_thread.cfa \ |
---|
137 | bits/signal.hfa \ |
---|
138 | concurrency/clib/cfathread.cfa \ |
---|
139 | concurrency/CtxSwitch-@ARCHITECTURE@.S \ |
---|
140 | concurrency/invoke.c \ |
---|
141 | concurrency/io.cfa \ |
---|
142 | concurrency/io/setup.cfa \ |
---|
143 | concurrency/io/types.hfa \ |
---|
144 | concurrency/io/call.cfa \ |
---|
145 | concurrency/iofwd.hfa \ |
---|
146 | concurrency/kernel/private.hfa \ |
---|
147 | concurrency/kernel/startup.cfa \ |
---|
148 | concurrency/preemption.cfa \ |
---|
149 | concurrency/preemption.hfa \ |
---|
150 | concurrency/ready_queue.cfa \ |
---|
151 | concurrency/ready_subqueue.hfa \ |
---|
152 | concurrency/snzi.hfa \ |
---|
153 | concurrency/stats.cfa \ |
---|
154 | concurrency/stats.hfa \ |
---|
155 | concurrency/stats.hfa \ |
---|
156 | concurrency/pthread.cfa |
---|
157 | |
---|
158 | else |
---|
159 | inst_headers_src = |
---|
160 | inst_thread_headers_src = |
---|
161 | inst_headers_nosrc = |
---|
162 | inst_thread_headers_nosrc = |
---|
163 | libsrc = |
---|
164 | endif |
---|
165 | |
---|
166 | |
---|
167 | #---------------------------------------------------------------------------------------------------------------- |
---|
168 | # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
169 | #@CFACC@ @CFACPP@ prelude.cfa |
---|
170 | |
---|
171 | # add dependency of cfa files |
---|
172 | libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc)))) |
---|
173 | $(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
174 | |
---|
175 | thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc)))) |
---|
176 | $(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
177 | |
---|
178 | |
---|
179 | # .deps inclusion is not done automatically by automake for new languages |
---|
180 | libdeps = $(join \ |
---|
181 | $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \ |
---|
182 | $(notdir ${libobjs:.lo=.Plo}) \ |
---|
183 | ) |
---|
184 | |
---|
185 | -include $(libdeps) |
---|
186 | |
---|
187 | thread_libdeps = $(join \ |
---|
188 | $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \ |
---|
189 | $(notdir ${thread_libobjs:.lo=.Plo}) \ |
---|
190 | ) |
---|
191 | |
---|
192 | -include $(thread_libdeps) |
---|
193 | |
---|
194 | |
---|
195 | if ENABLE_DISTCC |
---|
196 | |
---|
197 | ../prelude/distribution: @LOCAL_CFACC@ @LOCAL_CC1@ @CFACPP@ ../prelude/defines.hfa ../prelude/gcc-builtins.cf ../prelude/builtins.cf ../prelude/extras.cf ../prelude/prelude.cfa ../prelude/bootloader.c $(srcdir)/../../tools/build/push2dist.sh |
---|
198 | @+make -C ../prelude distribution |
---|
199 | |
---|
200 | prelude.o prelude.lo $(libobjs) $(thread_libobjs) : ../prelude/distribution |
---|
201 | |
---|
202 | endif ENABLE_DISTCC |
---|
203 | |
---|
204 | prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@ |
---|
205 | ${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@} |
---|
206 | |
---|
207 | prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@ |
---|
208 | ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ |
---|
209 | $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@} |
---|
210 | |
---|
211 | concurrency/io/call.cfa: $(srcdir)/concurrency/io/call.cfa.in |
---|
212 | ${AM_V_GEN}python3 $< > $@ |
---|
213 | |
---|
214 | #---------------------------------------------------------------------------------------------------------------- |
---|
215 | libcfa_la_SOURCES = ${libsrc} |
---|
216 | nodist_libcfa_la_SOURCES = prelude.cfa |
---|
217 | libcfa_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
218 | |
---|
219 | libcfathread_la_SOURCES = ${thread_libsrc} |
---|
220 | libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
221 | |
---|
222 | stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ") |
---|
223 | |
---|
224 | cfa_includedir = $(CFA_INCDIR) |
---|
225 | nobase_cfa_include_HEADERS = ${stdhdr} ${inst_headers_src} ${inst_headers_nosrc} ${inst_thread_headers_src} ${inst_thread_headers_nosrc} |
---|
226 | EXTRA_DIST = stdhdr |
---|
227 | DISTCLEANFILES = $(libdeps) $(thread_libdeps) |
---|
228 | |
---|
229 | #---------------------------------------------------------------------------------------------------------------- |
---|
230 | maintainer-clean-local: |
---|
231 | -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} |
---|
232 | |
---|
233 | #distclean-local: |
---|
234 | # find ${builddir} -path '*.Plo' -delete |
---|
235 | |
---|
236 | |
---|
237 | # $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ |
---|
238 | # $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ |
---|
239 | # $(am__mv) $$depbase.Tpo $$depbase.Po |
---|