[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] | 18 | AUTOMAKE_OPTIONS = foreign subdir-objects |
---|
| 19 | ACLOCAL_AMFLAGS = -I automake |
---|
[a922e34] | 20 | |
---|
[bcadb26] | 21 | include $(top_srcdir)/../tools/build/cfa.make |
---|
[ba9baad] | 22 | |
---|
[088a5cd] | 23 | libdir = ${CFA_LIBDIR} |
---|
[8ac3b0e] | 24 | lib_LTLIBRARIES = libcfa.la libcfathread.la |
---|
[3d50aaf] | 25 | |
---|
[a9fb796] | 26 | VPATH += :../prelude |
---|
| 27 | |
---|
[dee1f89] | 28 | gdbwaittarget="" |
---|
| 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] | 34 | AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr -I$(srcdir)/concurrency $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ |
---|
[fa2a3b1] | 35 | AM_CFLAGS = -g -Wall -Werror=return-type -Wno-unused-function -fPIC -fexceptions -fvisibility=hidden -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
[850aff1] | 36 | AM_CCASFLAGS = -g -Wall -Werror=return-type -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
[ba9baad] | 37 | CFACC = @CFACC@ |
---|
[d3b7937] | 38 | |
---|
[73abe95] | 39 | #---------------------------------------------------------------------------------------------------------------- |
---|
[e523b07] | 40 | if BUILDLIB |
---|
[b7fe2e6] | 41 | inst_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 \ |
---|
[cfbc56ec] | 49 | raii.hfa \ |
---|
[b7fe2e6] | 50 | time_t.hfa \ |
---|
[360bfe41] | 51 | virtual_dtor.hfa \ |
---|
[3ad9097] | 52 | bits/algorithm.hfa \ |
---|
[b7fe2e6] | 53 | bits/align.hfa \ |
---|
[55b060d] | 54 | bits/collections.hfa \ |
---|
[b7fe2e6] | 55 | bits/debug.hfa \ |
---|
| 56 | bits/defs.hfa \ |
---|
| 57 | bits/locks.hfa \ |
---|
[7d4ce2a] | 58 | bits/collection.hfa \ |
---|
| 59 | bits/stack.hfa \ |
---|
| 60 | bits/queue.hfa \ |
---|
| 61 | bits/sequence.hfa \ |
---|
[0e6cadf1] | 62 | concurrency/atomic.hfa \ |
---|
[b7fe2e6] | 63 | concurrency/iofwd.hfa \ |
---|
[93b8cf4] | 64 | concurrency/barrier.hfa \ |
---|
[55b060d] | 65 | collections/array.hfa \ |
---|
| 66 | collections/list.hfa \ |
---|
| 67 | collections/lockfree.hfa \ |
---|
| 68 | collections/string_sharectx.hfa \ |
---|
| 69 | collections/vector2.hfa \ |
---|
[eef8dfb] | 70 | vec/vec.hfa \ |
---|
| 71 | vec/vec2.hfa \ |
---|
| 72 | vec/vec3.hfa \ |
---|
[360bfe41] | 73 | vec/vec4.hfa |
---|
[b7fe2e6] | 74 | |
---|
| 75 | inst_headers_src = \ |
---|
| 76 | common.hfa \ |
---|
| 77 | fstream.hfa \ |
---|
| 78 | heap.hfa \ |
---|
| 79 | iostream.hfa \ |
---|
| 80 | iterator.hfa \ |
---|
| 81 | limits.hfa \ |
---|
[108b2c7] | 82 | math.hfa \ |
---|
[4d9172f] | 83 | memory.hfa \ |
---|
[b7fe2e6] | 84 | parseargs.hfa \ |
---|
[16f9aca] | 85 | parseconfig.hfa \ |
---|
[b7fe2e6] | 86 | rational.hfa \ |
---|
[72713e5] | 87 | enum.hfa \ |
---|
[b7fe2e6] | 88 | stdlib.hfa \ |
---|
[96f002c1] | 89 | strstream.hfa \ |
---|
[b7fe2e6] | 90 | time.hfa \ |
---|
[ab1b971] | 91 | bits/weakso_locks.hfa \ |
---|
[58b2638] | 92 | algorithms/range_iterator.hfa \ |
---|
[55b060d] | 93 | collections/maybe.hfa \ |
---|
| 94 | collections/pair.hfa \ |
---|
| 95 | collections/result.hfa \ |
---|
| 96 | collections/string.hfa \ |
---|
| 97 | collections/string_res.hfa \ |
---|
| 98 | collections/vector.hfa \ |
---|
[96f002c1] | 99 | device/cpu.hfa |
---|
[b7fe2e6] | 100 | |
---|
| 101 | libsrc = ${inst_headers_src} ${inst_headers_src:.hfa=.cfa} \ |
---|
| 102 | assert.cfa \ |
---|
| 103 | bits/debug.cfa \ |
---|
| 104 | exception.c \ |
---|
| 105 | interpose.cfa \ |
---|
| 106 | lsda.h \ |
---|
| 107 | startup.cfa \ |
---|
| 108 | startup.hfa \ |
---|
| 109 | virtual.c \ |
---|
| 110 | virtual.h |
---|
[facc44f] | 111 | |
---|
| 112 | # not all platforms support concurrency, add option do disable it |
---|
[b7fe2e6] | 113 | inst_thread_headers_nosrc = \ |
---|
| 114 | bits/random.hfa \ |
---|
[bb662027] | 115 | concurrency/clib/cfathread.h \ |
---|
[b7fe2e6] | 116 | concurrency/invoke.h \ |
---|
[70f8bcd2] | 117 | concurrency/future.hfa \ |
---|
[e8b8e65] | 118 | concurrency/once.hfa \ |
---|
[3ad9097] | 119 | concurrency/kernel/fwd.hfa \ |
---|
[7eac70e] | 120 | concurrency/mutex_stmt.hfa \ |
---|
[0e6cadf1] | 121 | concurrency/channel.hfa \ |
---|
[e4c3819] | 122 | concurrency/actor.hfa |
---|
[b7fe2e6] | 123 | |
---|
| 124 | inst_thread_headers_src = \ |
---|
[ab388c5] | 125 | concurrency/alarm.hfa \ |
---|
[b7fe2e6] | 126 | concurrency/coroutine.hfa \ |
---|
[856dff8] | 127 | concurrency/exception.hfa \ |
---|
[b7fe2e6] | 128 | concurrency/kernel.hfa \ |
---|
[708ae38] | 129 | concurrency/kernel/cluster.hfa \ |
---|
[6a8882c] | 130 | concurrency/locks.hfa \ |
---|
[b7fe2e6] | 131 | concurrency/monitor.hfa \ |
---|
| 132 | concurrency/mutex.hfa \ |
---|
[0e6cadf1] | 133 | concurrency/select.hfa \ |
---|
[e4c3819] | 134 | concurrency/thread.hfa \ |
---|
| 135 | concurrency/cofor.hfa |
---|
[b7fe2e6] | 136 | |
---|
| 137 | thread_libsrc = ${inst_thread_headers_src} ${inst_thread_headers_src:.hfa=.cfa} \ |
---|
[95dab9e] | 138 | interpose_thread.cfa \ |
---|
[b7fe2e6] | 139 | bits/signal.hfa \ |
---|
[bb662027] | 140 | concurrency/clib/cfathread.cfa \ |
---|
[b7fe2e6] | 141 | concurrency/CtxSwitch-@ARCHITECTURE@.S \ |
---|
| 142 | concurrency/invoke.c \ |
---|
| 143 | concurrency/io.cfa \ |
---|
| 144 | concurrency/io/setup.cfa \ |
---|
| 145 | concurrency/io/types.hfa \ |
---|
[c402739f] | 146 | concurrency/io/call.cfa \ |
---|
[b7fe2e6] | 147 | concurrency/iofwd.hfa \ |
---|
[708ae38] | 148 | concurrency/kernel/private.hfa \ |
---|
[b7fe2e6] | 149 | concurrency/kernel/startup.cfa \ |
---|
| 150 | concurrency/preemption.cfa \ |
---|
| 151 | concurrency/preemption.hfa \ |
---|
| 152 | concurrency/ready_queue.cfa \ |
---|
| 153 | concurrency/ready_subqueue.hfa \ |
---|
| 154 | concurrency/snzi.hfa \ |
---|
| 155 | concurrency/stats.cfa \ |
---|
| 156 | concurrency/stats.hfa \ |
---|
[a7d696f] | 157 | concurrency/stats.hfa \ |
---|
| 158 | concurrency/pthread.cfa |
---|
[3e2b9c9] | 159 | |
---|
[e523b07] | 160 | else |
---|
[b7fe2e6] | 161 | inst_headers_src = |
---|
| 162 | inst_thread_headers_src = |
---|
| 163 | inst_headers_nosrc = |
---|
| 164 | inst_thread_headers_nosrc = |
---|
[e523b07] | 165 | libsrc = |
---|
| 166 | endif |
---|
| 167 | |
---|
[ac78e25] | 168 | |
---|
[73abe95] | 169 | #---------------------------------------------------------------------------------------------------------------- |
---|
| 170 | # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
[e523b07] | 171 | #@CFACC@ @CFACPP@ prelude.cfa |
---|
[a9fb796] | 172 | |
---|
| 173 | # add dependency of cfa files |
---|
[6d44da1] | 174 | libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc)))) |
---|
[14347ac] | 175 | $(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
[a9fb796] | 176 | |
---|
[2026bb6] | 177 | thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc)))) |
---|
[14347ac] | 178 | $(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
[2026bb6] | 179 | |
---|
[a9fb796] | 180 | |
---|
| 181 | # .deps inclusion is not done automatically by automake for new languages |
---|
| 182 | libdeps = $(join \ |
---|
| 183 | $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \ |
---|
[2a75572] | 184 | $(notdir ${libobjs:.lo=.Plo}) \ |
---|
[a9fb796] | 185 | ) |
---|
[d3b7937] | 186 | |
---|
[0765121] | 187 | -include $(libdeps) |
---|
[a9fb796] | 188 | |
---|
[2026bb6] | 189 | thread_libdeps = $(join \ |
---|
| 190 | $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \ |
---|
| 191 | $(notdir ${thread_libobjs:.lo=.Plo}) \ |
---|
| 192 | ) |
---|
| 193 | |
---|
| 194 | -include $(thread_libdeps) |
---|
| 195 | |
---|
| 196 | |
---|
[31d8f4d] | 197 | if ENABLE_DISTCC |
---|
| 198 | |
---|
[be3f163] | 199 | ../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] | 200 | @+make -C ../prelude distribution |
---|
| 201 | |
---|
| 202 | prelude.o prelude.lo $(libobjs) $(thread_libobjs) : ../prelude/distribution |
---|
| 203 | |
---|
| 204 | endif ENABLE_DISTCC |
---|
| 205 | |
---|
[be3f163] | 206 | prelude.o : prelude.cfa extras.cfa gcc-builtins.cfa builtins.cfa @LOCAL_CFACC@ @CFACPP@ |
---|
[fa2a3b1] | 207 | ${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@} |
---|
[d3b7937] | 208 | |
---|
[be3f163] | 209 | prelude.lo: prelude.cfa extras.cfa gcc-builtins.cfa builtins.cfa @LOCAL_CFACC@ @CFACPP@ |
---|
[c6bbcdb] | 210 | ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ |
---|
[fa2a3b1] | 211 | $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -fvisibility=default -o ${@} |
---|
[a9fb796] | 212 | |
---|
[fdc3f9d] | 213 | concurrency/io/call.cfa: $(srcdir)/concurrency/io/call.cfa.in |
---|
| 214 | ${AM_V_GEN}python3 $< > $@ |
---|
| 215 | |
---|
[a9fb796] | 216 | #---------------------------------------------------------------------------------------------------------------- |
---|
[c2bc6d5] | 217 | libcfa_la_SOURCES = ${libsrc} |
---|
| 218 | nodist_libcfa_la_SOURCES = prelude.cfa |
---|
[c6bbcdb] | 219 | libcfa_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
[bd85400] | 220 | |
---|
[2026bb6] | 221 | libcfathread_la_SOURCES = ${thread_libsrc} |
---|
| 222 | libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
| 223 | |
---|
[38d12e7] | 224 | stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ") |
---|
[ed0e67a] | 225 | |
---|
[e958ff8] | 226 | cfa_includedir = $(CFA_INCDIR) |
---|
[b7fe2e6] | 227 | nobase_cfa_include_HEADERS = ${stdhdr} ${inst_headers_src} ${inst_headers_nosrc} ${inst_thread_headers_src} ${inst_thread_headers_nosrc} |
---|
| 228 | EXTRA_DIST = stdhdr |
---|
[5ce7f4a] | 229 | DISTCLEANFILES = $(libdeps) $(thread_libdeps) |
---|
[73abe95] | 230 | |
---|
| 231 | #---------------------------------------------------------------------------------------------------------------- |
---|
[159c62e] | 232 | maintainer-clean-local: |
---|
[796cea3] | 233 | -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} |
---|
[a9fb796] | 234 | |
---|
[5ce7f4a] | 235 | #distclean-local: |
---|
| 236 | # find ${builddir} -path '*.Plo' -delete |
---|
[2a59655] | 237 | |
---|
[a9fb796] | 238 | |
---|
| 239 | # $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ |
---|
| 240 | # $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ |
---|
| 241 | # $(am__mv) $$depbase.Tpo $$depbase.Po |
---|