source: libcfa/src/Makefile.am @ 54af365

Last change on this file since 54af365 was cfbc56ec, checked in by Michael Brooks <mlbrooks@…>, 6 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
RevLine 
[00cc023]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##
[d63eeb0]8## Makefile.am --
[00cc023]9##
10## Author           : Peter A. Buhr
11## Created On       : Sun May 31 08:54:01 2015
[381fdee]12## Last Modified By : Peter A. Buhr
[be3f163]13## Last Modified On : Wed Nov  1 19:03:42 2023
14## Update Count     : 266
[00cc023]15###############################################################################
16
[a922e34]17# create object files in directory with source files
[38d12e7]18AUTOMAKE_OPTIONS = foreign subdir-objects
19ACLOCAL_AMFLAGS  = -I automake
[a922e34]20
[bcadb26]21include $(top_srcdir)/../tools/build/cfa.make
[ba9baad]22
[088a5cd]23libdir = ${CFA_LIBDIR}
[8ac3b0e]24lib_LTLIBRARIES = libcfa.la libcfathread.la
[3d50aaf]25
[a9fb796]26VPATH += :../prelude
27
[dee1f89]28gdbwaittarget=""
29
[ba9baad]30# AM_CFLAGS for all cfa source
31# AM_CFAFLAGS for only cfa source
32# use -no-include-stdhdr to prevent rebuild cycles
[b7fe2e6]33# The built sources must not depend on the installed inst_headers_src
[2fbc904]34AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr -I$(srcdir)/concurrency $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@
[fa2a3b1]35AM_CFLAGS = -g -Wall -Werror=return-type -Wno-unused-function -fPIC -fexceptions -fvisibility=hidden -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@
[850aff1]36AM_CCASFLAGS = -g -Wall -Werror=return-type -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
[ba9baad]37CFACC = @CFACC@
[d3b7937]38
[73abe95]39#----------------------------------------------------------------------------------------------------------------
[e523b07]40if BUILDLIB
[b7fe2e6]41inst_headers_nosrc = \
[3543e99]42        Exception.hfa \
[b7fe2e6]43        bitmanip.hfa \
44        clock.hfa \
45        exception.hfa \
[d7a10af]46        exception.h \
[b7fe2e6]47        gmp.hfa \
[08bc3e7]48        math.trait.hfa \
[b7fe2e6]49        math.hfa \
[cfbc56ec]50        raii.hfa \
[b7fe2e6]51        time_t.hfa \
[360bfe41]52        virtual_dtor.hfa \
[3ad9097]53        bits/algorithm.hfa \
[b7fe2e6]54        bits/align.hfa \
[55b060d]55        bits/collections.hfa \
[b7fe2e6]56        bits/debug.hfa \
57        bits/defs.hfa \
58        bits/locks.hfa \
[7d4ce2a]59        bits/collection.hfa \
60        bits/stack.hfa \
61        bits/queue.hfa \
62        bits/sequence.hfa \
[0e6cadf]63        concurrency/atomic.hfa \
[b7fe2e6]64        concurrency/iofwd.hfa \
[93b8cf4]65        concurrency/barrier.hfa \
[55b060d]66        collections/array.hfa \
67        collections/list.hfa \
68        collections/lockfree.hfa \
69        collections/string_sharectx.hfa \
70        collections/vector2.hfa \
[eef8dfb]71        vec/vec.hfa \
72        vec/vec2.hfa \
73        vec/vec3.hfa \
[360bfe41]74        vec/vec4.hfa
[b7fe2e6]75
76inst_headers_src = \
77        common.hfa \
78        fstream.hfa \
79        heap.hfa \
80        iostream.hfa \
81        iterator.hfa \
82        limits.hfa \
[4d9172f]83        memory.hfa \
[b7fe2e6]84        parseargs.hfa \
[16f9aca]85        parseconfig.hfa \
[b7fe2e6]86        rational.hfa \
87        stdlib.hfa \
[96f002c1]88        strstream.hfa \
[b7fe2e6]89        time.hfa \
[ab1b971]90        bits/weakso_locks.hfa \
[58b2638]91        algorithms/range_iterator.hfa \
[55b060d]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 \
[96f002c1]98        device/cpu.hfa
[b7fe2e6]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
[facc44f]110
111# not all platforms support concurrency, add option do disable it
[b7fe2e6]112inst_thread_headers_nosrc = \
113        bits/random.hfa \
[bb662027]114        concurrency/clib/cfathread.h \
[b7fe2e6]115        concurrency/invoke.h \
[70f8bcd2]116        concurrency/future.hfa \
[e8b8e65]117        concurrency/once.hfa \
[3ad9097]118        concurrency/kernel/fwd.hfa \
[7eac70e]119        concurrency/mutex_stmt.hfa \
[0e6cadf]120        concurrency/channel.hfa \
[e4c3819]121        concurrency/actor.hfa
[b7fe2e6]122
123inst_thread_headers_src = \
[ab388c5]124        concurrency/alarm.hfa \
[b7fe2e6]125        concurrency/coroutine.hfa \
[856dff8]126        concurrency/exception.hfa \
[b7fe2e6]127        concurrency/kernel.hfa \
[708ae38]128        concurrency/kernel/cluster.hfa \
[6a8882c]129        concurrency/locks.hfa \
[b7fe2e6]130        concurrency/monitor.hfa \
131        concurrency/mutex.hfa \
[0e6cadf]132        concurrency/select.hfa \
[e4c3819]133        concurrency/thread.hfa \
134        concurrency/cofor.hfa
[b7fe2e6]135
136thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \
[95dab9e]137        interpose_thread.cfa \
[b7fe2e6]138        bits/signal.hfa \
[bb662027]139        concurrency/clib/cfathread.cfa \
[b7fe2e6]140        concurrency/CtxSwitch-@ARCHITECTURE@.S \
141        concurrency/invoke.c \
142        concurrency/io.cfa \
143        concurrency/io/setup.cfa \
144        concurrency/io/types.hfa \
[c402739f]145        concurrency/io/call.cfa \
[b7fe2e6]146        concurrency/iofwd.hfa \
[708ae38]147        concurrency/kernel/private.hfa \
[b7fe2e6]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 \
[a7d696f]156        concurrency/stats.hfa \
157        concurrency/pthread.cfa
[3e2b9c9]158
[e523b07]159else
[b7fe2e6]160inst_headers_src =
161inst_thread_headers_src =
162inst_headers_nosrc =
163inst_thread_headers_nosrc =
[e523b07]164libsrc =
165endif
166
[ac78e25]167
[73abe95]168#----------------------------------------------------------------------------------------------------------------
169# add dependency to cfa-cpp so all libraries are rebuilt with new translator
[e523b07]170#@CFACC@ @CFACPP@ prelude.cfa
[a9fb796]171
172# add dependency of cfa files
[6d44da1]173libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc))))
[14347ac]174$(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
[a9fb796]175
[2026bb6]176thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc))))
[14347ac]177$(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
[2026bb6]178
[a9fb796]179
180# .deps inclusion is not done automatically by automake for new languages
181libdeps = $(join \
182        $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \
[2a75572]183        $(notdir ${libobjs:.lo=.Plo}) \
[a9fb796]184)
[d3b7937]185
[0765121]186-include $(libdeps)
[a9fb796]187
[2026bb6]188thread_libdeps = $(join \
189        $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \
190        $(notdir ${thread_libobjs:.lo=.Plo}) \
191)
192
193-include $(thread_libdeps)
194
195
[31d8f4d]196if ENABLE_DISTCC
197
[be3f163]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
[31d8f4d]199        @+make -C ../prelude distribution
200
201prelude.o prelude.lo $(libobjs) $(thread_libobjs) : ../prelude/distribution
202
203endif ENABLE_DISTCC
204
[be3f163]205prelude.o : prelude.cfa extras.cfa gcc-builtins.cfa builtins.cfa @LOCAL_CFACC@ @CFACPP@
[fa2a3b1]206        ${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@}
[d3b7937]207
[be3f163]208prelude.lo: prelude.cfa extras.cfa gcc-builtins.cfa builtins.cfa @LOCAL_CFACC@ @CFACPP@
[c6bbcdb]209        ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
[fa2a3b1]210        $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@}
[a9fb796]211
[fdc3f9d]212concurrency/io/call.cfa: $(srcdir)/concurrency/io/call.cfa.in
213        ${AM_V_GEN}python3 $< > $@
214
[a9fb796]215#----------------------------------------------------------------------------------------------------------------
[c2bc6d5]216libcfa_la_SOURCES = ${libsrc}
217nodist_libcfa_la_SOURCES = prelude.cfa
[c6bbcdb]218libcfa_la_LDFLAGS = -version-info @CFA_VERSION@
[bd85400]219
[2026bb6]220libcfathread_la_SOURCES = ${thread_libsrc}
221libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@
222
[38d12e7]223stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ")
[ed0e67a]224
[e958ff8]225cfa_includedir = $(CFA_INCDIR)
[b7fe2e6]226nobase_cfa_include_HEADERS = ${stdhdr} ${inst_headers_src} ${inst_headers_nosrc} ${inst_thread_headers_src} ${inst_thread_headers_nosrc}
227EXTRA_DIST = stdhdr
[5ce7f4a]228DISTCLEANFILES = $(libdeps) $(thread_libdeps)
[73abe95]229
230#----------------------------------------------------------------------------------------------------------------
[159c62e]231maintainer-clean-local:
[796cea3]232        -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR}
[a9fb796]233
[5ce7f4a]234#distclean-local:
235#       find ${builddir} -path '*.Plo' -delete
[2a59655]236
[a9fb796]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.