source: libcfa/src/Makefile.am@ e8b3717

Last change on this file since e8b3717 was cfbc56ec, checked in by Michael Brooks <mlbrooks@…>, 20 months ago

Enable array RAII and provide uninit(-), a uNoCtor equivalent.

Enable construction/destruction of "new" CFA array elements,
which was previously deactivated to avoid a compiler performance issue.
The enabled RAII steps more carefully around the performance issue.

Provide uninit(-), with tests covering the typical use case:

struct Foo;
void ?{}( Foo & this, int i ) { printf( "ctor at %d\n", i ); }
uninit(Foo) a[10]; no prints
for (i; 10) (a[i]){ i };
prints
array(uninit(Foo), 10) b; no prints
for (i; 10) (b[i]){ i };
prints

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