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 : Mon Jun 1 13:35:33 2020 |
---|
14 | ## Update Count : 248 |
---|
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 headers |
---|
34 | AM_CFAFLAGS = -quiet -cfalib -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ |
---|
35 | AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC -fexceptions -pthread @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
36 | AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ |
---|
37 | CFACC = @CFACC@ |
---|
38 | |
---|
39 | #---------------------------------------------------------------------------------------------------------------- |
---|
40 | if BUILDLIB |
---|
41 | headers_nosrc = bitmanip.hfa exception.hfa math.hfa gmp.hfa time_t.hfa clock.hfa \ |
---|
42 | bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa \ |
---|
43 | containers/list.hfa containers/stackLockFree.hfa concurrency/iofwd.hfa |
---|
44 | |
---|
45 | headers = common.hfa fstream.hfa heap.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa \ |
---|
46 | time.hfa stdlib.hfa memory.hfa parseargs.hfa \ |
---|
47 | containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa |
---|
48 | |
---|
49 | libsrc = startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c ${headers:.hfa=.cfa} |
---|
50 | |
---|
51 | # not all platforms support concurrency, add option do disable it |
---|
52 | thread_headers_nosrc = bits/random.hfa concurrency/invoke.h concurrency/kernel/fwd.hfa |
---|
53 | |
---|
54 | thread_headers = concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa \ |
---|
55 | concurrency/monitor.hfa concurrency/mutex.hfa |
---|
56 | |
---|
57 | thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa \ |
---|
58 | concurrency/invoke.c concurrency/io.cfa concurrency/iocall.cfa \ |
---|
59 | concurrency/io/setup.cfa \ |
---|
60 | concurrency/kernel/startup.cfa concurrency/preemption.cfa \ |
---|
61 | concurrency/ready_queue.cfa concurrency/stats.cfa \ |
---|
62 | ${thread_headers:.hfa=.cfa} |
---|
63 | else |
---|
64 | headers = |
---|
65 | thread_headers = |
---|
66 | headers_nosrc = |
---|
67 | thread_headers_nosrc = |
---|
68 | libsrc = |
---|
69 | endif |
---|
70 | |
---|
71 | |
---|
72 | #---------------------------------------------------------------------------------------------------------------- |
---|
73 | # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
74 | #@CFACC@ @CFACPP@ prelude.cfa |
---|
75 | |
---|
76 | # add dependency of cfa files |
---|
77 | libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc)))) |
---|
78 | $(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
79 | |
---|
80 | thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc)))) |
---|
81 | $(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa |
---|
82 | |
---|
83 | |
---|
84 | # .deps inclusion is not done automatically by automake for new languages |
---|
85 | libdeps = $(join \ |
---|
86 | $(addsuffix $(DEPDIR)/ , $(dir $(libobjs) ) ), \ |
---|
87 | $(notdir ${libobjs:.lo=.Plo}) \ |
---|
88 | ) |
---|
89 | |
---|
90 | -include $(libdeps) |
---|
91 | |
---|
92 | thread_libdeps = $(join \ |
---|
93 | $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \ |
---|
94 | $(notdir ${thread_libobjs:.lo=.Plo}) \ |
---|
95 | ) |
---|
96 | |
---|
97 | -include $(thread_libdeps) |
---|
98 | |
---|
99 | |
---|
100 | if ENABLE_DISTCC |
---|
101 | |
---|
102 | ../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 |
---|
103 | @+make -C ../prelude distribution |
---|
104 | |
---|
105 | prelude.o prelude.lo $(libobjs) $(thread_libobjs) : ../prelude/distribution |
---|
106 | |
---|
107 | endif ENABLE_DISTCC |
---|
108 | |
---|
109 | prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@ |
---|
110 | ${AM_V_GEN}$(CFACOMPILE) -quiet -XCFA,-l ${<} -c -o ${@} |
---|
111 | |
---|
112 | prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@ |
---|
113 | ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ |
---|
114 | $(CFACOMPILE) -quiet -XCFA,-l ${<} -c -o ${@} |
---|
115 | |
---|
116 | #---------------------------------------------------------------------------------------------------------------- |
---|
117 | libcfa_la_SOURCES = prelude.cfa ${libsrc} |
---|
118 | libcfa_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
119 | |
---|
120 | libcfathread_la_SOURCES = ${thread_libsrc} |
---|
121 | libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@ |
---|
122 | |
---|
123 | stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ") |
---|
124 | |
---|
125 | cfa_includedir = $(CFA_INCDIR) |
---|
126 | nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc} ${thread_headers} ${thread_headers_nosrc} |
---|
127 | |
---|
128 | #---------------------------------------------------------------------------------------------------------------- |
---|
129 | maintainer-clean-local: |
---|
130 | -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} |
---|
131 | |
---|
132 | |
---|
133 | # $(AM_V_CFA)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ |
---|
134 | # $(CFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ |
---|
135 | # $(am__mv) $$depbase.Tpo $$depbase.Po |
---|