source: libcfa/src/Makefile.am@ 80d16f8

ADT ast-experimental pthread-emulation
Last change on this file since 80d16f8 was 5ce7f4a, checked in by Thierry Delisle <tdelisle@…>, 3 years ago

Makefile no longer looks for dependencies to clean and instead uses libdeps/thread_libdeps directly.
This removes a race where folders can be erased while the find command is searching.

  • Property mode set to 100644
File size: 6.7 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 : Fri Jul 16 16:00:40 2021
14## Update Count : 255
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 bitmanip.hfa \
43 clock.hfa \
44 exception.hfa \
45 exception.h \
46 gmp.hfa \
47 math.trait.hfa \
48 math.hfa \
49 time_t.hfa \
50 bits/algorithm.hfa \
51 bits/align.hfa \
52 bits/containers.hfa \
53 bits/debug.hfa \
54 bits/defs.hfa \
55 bits/locks.hfa \
56 bits/collection.hfa \
57 bits/stack.hfa \
58 bits/queue.hfa \
59 bits/sequence.hfa \
60 concurrency/iofwd.hfa \
61 concurrency/barrier.hfa \
62 containers/array.hfa \
63 containers/list.hfa \
64 containers/queueLockFree.hfa \
65 containers/stackLockFree.hfa \
66 containers/string_sharectx.hfa \
67 containers/vector2.hfa \
68 vec/vec.hfa \
69 vec/vec2.hfa \
70 vec/vec3.hfa \
71 vec/vec4.hfa
72
73inst_headers_src = \
74 common.hfa \
75 fstream.hfa \
76 heap.hfa \
77 iostream.hfa \
78 iterator.hfa \
79 limits.hfa \
80 memory.hfa \
81 parseargs.hfa \
82 parseconfig.hfa \
83 rational.hfa \
84 stdlib.hfa \
85 strstream.hfa \
86 time.hfa \
87 bits/weakso_locks.hfa \
88 algorithms/range_iterator.hfa \
89 containers/maybe.hfa \
90 containers/pair.hfa \
91 containers/result.hfa \
92 containers/string.hfa \
93 containers/string_res.hfa \
94 containers/vector.hfa \
95 device/cpu.hfa
96
97libsrc = ${inst_headers_src} ${inst_headers_src:.hfa=.cfa} \
98 assert.cfa \
99 bits/debug.cfa \
100 exception.c \
101 interpose.cfa \
102 lsda.h \
103 startup.cfa \
104 startup.hfa \
105 virtual.c \
106 virtual.h
107
108# not all platforms support concurrency, add option do disable it
109inst_thread_headers_nosrc = \
110 bits/random.hfa \
111 concurrency/clib/cfathread.h \
112 concurrency/invoke.h \
113 concurrency/future.hfa \
114 concurrency/kernel/fwd.hfa \
115 concurrency/mutex_stmt.hfa
116
117inst_thread_headers_src = \
118 concurrency/alarm.hfa \
119 concurrency/coroutine.hfa \
120 concurrency/exception.hfa \
121 concurrency/kernel.hfa \
122 concurrency/kernel/cluster.hfa \
123 concurrency/locks.hfa \
124 concurrency/monitor.hfa \
125 concurrency/mutex.hfa \
126 concurrency/thread.hfa
127
128thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \
129 bits/signal.hfa \
130 concurrency/clib/cfathread.cfa \
131 concurrency/CtxSwitch-@ARCHITECTURE@.S \
132 concurrency/invoke.c \
133 concurrency/io.cfa \
134 concurrency/io/setup.cfa \
135 concurrency/io/types.hfa \
136 concurrency/io/call.cfa \
137 concurrency/iofwd.hfa \
138 concurrency/kernel/private.hfa \
139 concurrency/kernel/startup.cfa \
140 concurrency/preemption.cfa \
141 concurrency/preemption.hfa \
142 concurrency/ready_queue.cfa \
143 concurrency/ready_subqueue.hfa \
144 concurrency/snzi.hfa \
145 concurrency/stats.cfa \
146 concurrency/stats.hfa \
147 concurrency/stats.hfa
148
149else
150inst_headers_src =
151inst_thread_headers_src =
152inst_headers_nosrc =
153inst_thread_headers_nosrc =
154libsrc =
155endif
156
157
158#----------------------------------------------------------------------------------------------------------------
159# add dependency to cfa-cpp so all libraries are rebuilt with new translator
160#@CFACC@ @CFACPP@ prelude.cfa
161
162# add dependency of cfa files
163libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc))))
164$(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
165
166thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc))))
167$(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
168
169
170# .deps inclusion is not done automatically by automake for new languages
171libdeps = $(join \
172 $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \
173 $(notdir ${libobjs:.lo=.Plo}) \
174)
175
176-include $(libdeps)
177
178thread_libdeps = $(join \
179 $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \
180 $(notdir ${thread_libobjs:.lo=.Plo}) \
181)
182
183-include $(thread_libdeps)
184
185
186if ENABLE_DISTCC
187
188../prelude/distribution: @LOCAL_CFACC@ @LOCAL_CC1@ @CFACPP@ ../prelude/gcc-builtins.cf ../prelude/builtins.cf ../prelude/extras.cf ../prelude/prelude.cfa ../prelude/bootloader.c $(srcdir)/../../tools/build/push2dist.sh
189 @+make -C ../prelude distribution
190
191prelude.o prelude.lo $(libobjs) $(thread_libobjs) : ../prelude/distribution
192
193endif ENABLE_DISTCC
194
195prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
196 ${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@}
197
198prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
199 ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
200 $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@}
201
202concurrency/io/call.cfa: $(srcdir)/concurrency/io/call.cfa.in
203 ${AM_V_GEN}python3 $< > $@
204
205#----------------------------------------------------------------------------------------------------------------
206libcfa_la_SOURCES = ${libsrc}
207nodist_libcfa_la_SOURCES = prelude.cfa
208libcfa_la_LDFLAGS = -version-info @CFA_VERSION@
209
210libcfathread_la_SOURCES = ${thread_libsrc}
211libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@
212
213stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ")
214
215cfa_includedir = $(CFA_INCDIR)
216nobase_cfa_include_HEADERS = ${stdhdr} ${inst_headers_src} ${inst_headers_nosrc} ${inst_thread_headers_src} ${inst_thread_headers_nosrc}
217EXTRA_DIST = stdhdr
218DISTCLEANFILES = $(libdeps) $(thread_libdeps)
219
220#----------------------------------------------------------------------------------------------------------------
221maintainer-clean-local:
222 -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR}
223
224#distclean-local:
225# find ${builddir} -path '*.Plo' -delete
226
227
228# $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
229# $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
230# $(am__mv) $$depbase.Tpo $$depbase.Po
Note: See TracBrowser for help on using the repository browser.