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