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 : Tue Mar 27 14:27:05 2018 |
---|
14 | ## Update Count : 225 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | # create object files in directory with source files |
---|
18 | AUTOMAKE_OPTIONS = subdir-objects |
---|
19 | ARFLAGS = cr |
---|
20 | |
---|
21 | libdir = ${CFA_LIBDIR} |
---|
22 | lib_LIBRARIES = |
---|
23 | |
---|
24 | if BUILD_RELEASE |
---|
25 | lib_LIBRARIES += libcfa.a |
---|
26 | endif |
---|
27 | |
---|
28 | if BUILD_DEBUG |
---|
29 | lib_LIBRARIES += libcfa-d.a |
---|
30 | endif |
---|
31 | |
---|
32 | libcfa_a-libcfa-prelude.o : libcfa-prelude.c |
---|
33 | ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $< |
---|
34 | |
---|
35 | libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c |
---|
36 | ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $< |
---|
37 | |
---|
38 | EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ |
---|
39 | |
---|
40 | AM_CCASFLAGS = @CFA_FLAGS@ |
---|
41 | |
---|
42 | #CFLAGS for most libcfa src |
---|
43 | #use -no-include-stdhdr to prevent rebuild cycles |
---|
44 | #The built sources must not depend on the installed headers |
---|
45 | CFLAGS = -quiet -no-include-stdhdr -I${abs_top_srcdir}/src/libcfa/stdhdr -XCFA -t -B${abs_top_srcdir}/src/driver ${EXTRA_FLAGS} |
---|
46 | CC = ${abs_top_srcdir}/src/driver/cfa |
---|
47 | |
---|
48 | headers = fstream iostream iterator limits rational time stdlib \ |
---|
49 | containers/maybe containers/pair containers/result containers/vector |
---|
50 | |
---|
51 | # not all platforms support concurrency, add option do disable it |
---|
52 | if BUILD_CONCURRENCY |
---|
53 | headers += concurrency/coroutine concurrency/thread concurrency/kernel concurrency/monitor |
---|
54 | endif |
---|
55 | |
---|
56 | libobjs = ${headers:=.o} |
---|
57 | libsrc = libcfa-prelude.c interpose.c bits/debug.c ${headers:=.c} \ |
---|
58 | assert.c exception.c virtual.c |
---|
59 | |
---|
60 | # not all platforms support concurrency, add option do disable it |
---|
61 | if BUILD_CONCURRENCY |
---|
62 | libsrc += concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c concurrency/invoke.c concurrency/preemption.c |
---|
63 | endif |
---|
64 | |
---|
65 | # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing |
---|
66 | % : %.c |
---|
67 | @true |
---|
68 | |
---|
69 | concurrency/libcfa_a-invoke.o : concurrency/invoke.c |
---|
70 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< |
---|
71 | |
---|
72 | libcfa_a-exception.o : exception.c |
---|
73 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< |
---|
74 | |
---|
75 | libcfa_a-virtual.o : virtual.c |
---|
76 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< |
---|
77 | |
---|
78 | concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c |
---|
79 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< |
---|
80 | |
---|
81 | libcfa_d_a-exception.o : exception.c |
---|
82 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< |
---|
83 | |
---|
84 | libcfa_d_a-virtual.o : virtual.c |
---|
85 | ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< |
---|
86 | |
---|
87 | ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
88 | |
---|
89 | libcfa_a_SOURCES = ${libsrc} |
---|
90 | libcfa_a_CFLAGS = -nodebug -O2 |
---|
91 | libcfa_d_a_SOURCES = ${libsrc} |
---|
92 | libcfa_d_a_CFLAGS = -debug -O0 #No need for __CFA_DEBUG__ since we pass -debug |
---|
93 | |
---|
94 | stdhdr = ${shell find stdhdr -type f -printf "%p "} |
---|
95 | |
---|
96 | cfa_includedir = $(CFA_INCDIR) |
---|
97 | nobase_cfa_include_HEADERS = \ |
---|
98 | ${headers} \ |
---|
99 | ${stdhdr} \ |
---|
100 | math \ |
---|
101 | gmp \ |
---|
102 | bits/align.h \ |
---|
103 | bits/cfatime.h \ |
---|
104 | bits/containers.h \ |
---|
105 | bits/defs.h \ |
---|
106 | bits/debug.h \ |
---|
107 | bits/locks.h \ |
---|
108 | concurrency/invoke.h |
---|
109 | |
---|
110 | CLEANFILES = libcfa-prelude.c |
---|
111 | |
---|
112 | maintainer-clean-local: |
---|
113 | -rm -rf ${CFA_INCDIR} ${CFA_LIBDIR} |
---|