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 Jul 5 16:49:38 2016 |
---|
14 | ## Update Count : 180 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | lib_LIBRARIES = libcfa.a |
---|
18 | |
---|
19 | # put into lib for now |
---|
20 | cfalibdir = ${libdir} |
---|
21 | cfalib_DATA = builtins.cf extras.cf prelude.cf |
---|
22 | |
---|
23 | # create forward declarations for gcc builtins |
---|
24 | extras.cf : extras.regx extras.c |
---|
25 | @BACKEND_CC@ -E ${srcdir}/extras.c | grep -f extras.regx > ${srcdir}/extras.cf |
---|
26 | |
---|
27 | builtins.cf : builtins.c |
---|
28 | if [ -e $< ] ; then \ |
---|
29 | @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \ |
---|
30 | fi |
---|
31 | |
---|
32 | builtins.c : builtins.def prototypes.awk |
---|
33 | if [ -e $< ] ; then \ |
---|
34 | @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \ |
---|
35 | fi |
---|
36 | |
---|
37 | builtins.def : |
---|
38 | |
---|
39 | prototypes.awk : |
---|
40 | |
---|
41 | MAINTAINERCLEANFILES = builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} |
---|
42 | |
---|
43 | #-------------------------------------------------- |
---|
44 | |
---|
45 | libcfa-prelude.c : ${srcdir}/prelude.cf ${srcdir}/extras.cf ${srcdir}/builtins.cf |
---|
46 | ${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install |
---|
47 | |
---|
48 | libcfa-prelude.o : libcfa-prelude.c |
---|
49 | @BACKEND_CC@ -c -o $@ $< |
---|
50 | |
---|
51 | CFLAGS = -quiet -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2 |
---|
52 | CC = ${abs_top_srcdir}/src/driver/cfa |
---|
53 | |
---|
54 | headers = limits stdlib math iostream fstream iterator rational containers/vector |
---|
55 | libobjs = ${headers:=.o} |
---|
56 | |
---|
57 | # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing |
---|
58 | % : %.c |
---|
59 | @true |
---|
60 | |
---|
61 | ${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp ${cfalib_DATA} # add dependency to cfa-cpp so all libraries are rebuilt with new translator |
---|
62 | |
---|
63 | libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c} |
---|
64 | |
---|
65 | nobase_include_HEADERS = ${headers} stdio.h |
---|
66 | |
---|
67 | CLEANFILES = libcfa-prelude.c |
---|
68 | |
---|
69 | maintainer-clean-local: |
---|
70 | -rm -rf ${includedir}/* |
---|