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 : Wed Feb 3 11:19:35 2016
|
---|
14 | ## Update Count : 117
|
---|
15 | ###############################################################################
|
---|
16 |
|
---|
17 | lib_LIBRARIES = libcfa.a
|
---|
18 |
|
---|
19 | # put into lib for now
|
---|
20 | cfalibdir = ${libdir}
|
---|
21 | cfalib_DATA = prelude.cf builtins.cf
|
---|
22 |
|
---|
23 | # create forward declarations for gcc builtins
|
---|
24 | ${libdir}/builtins.cf : ${libdir} ${srcdir}/builtins.cf
|
---|
25 | ${INSTALL} ${srcdir}/builtins.cf ${libdir}
|
---|
26 | sed -i -e "s#typedef.*ptrdiff_t.*#`@BACKEND_CC@ -E ${srcdir}/ptrdiff_t.c | grep 'typedef.*ptrdiff_t'`#" ${srcdir}/prelude.cf
|
---|
27 |
|
---|
28 | builtins.cf : builtins.c
|
---|
29 | @if [ -e $< ] ; then \
|
---|
30 | @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \
|
---|
31 | fi
|
---|
32 |
|
---|
33 | builtins.c : builtins.def prototypes.awk
|
---|
34 | @if [ -e $< ] ; then \
|
---|
35 | @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \
|
---|
36 | fi
|
---|
37 |
|
---|
38 | builtins.def :
|
---|
39 |
|
---|
40 | prototypes.awk :
|
---|
41 |
|
---|
42 | MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
|
---|
43 |
|
---|
44 | #--------------------------------------------------
|
---|
45 |
|
---|
46 | libcfa-prelude.c : ${srcdir}/prelude.cf
|
---|
47 | ${abs_top_srcdir}/src/driver/cfa-cpp -l ${srcdir}/prelude.cf $@ # use src/cfa-cpp as not in lib until after install
|
---|
48 |
|
---|
49 | libcfa-prelude.o : libcfa-prelude.c
|
---|
50 | @BACKEND_CC@ -c -o $@ $<
|
---|
51 |
|
---|
52 | CFLAGS = -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t # TEMPORARY: does not build with -O2
|
---|
53 | CC = ${abs_top_srcdir}/src/driver/cfa
|
---|
54 |
|
---|
55 | # extension-less header files are overridden by default make rules => explicitly override rule
|
---|
56 | % : %.c
|
---|
57 | true
|
---|
58 |
|
---|
59 | .c.o : ${abs_top_srcdir}/src/driver/cfa-cpp
|
---|
60 | ${CC} ${CFLAGS} -c -o $@ $<
|
---|
61 |
|
---|
62 | libs = # stdlib iostream fstream iterator # temporarily getting rid of these until ctor/dtor autogen works
|
---|
63 | libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
|
---|
64 |
|
---|
65 | cheaders = bfd bfdlink demangle dialog evdns evhttp evrpc expat fcntl form gcrypt math
|
---|
66 | cfaheaders = limits
|
---|
67 | include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders}
|
---|
68 |
|
---|
69 | MAINTAINERCLEANFILES += ${includedir}/*
|
---|