1 | b######################### -*- Mode: Makefile-Gmake -*- ######################## |
---|
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.in -- |
---|
9 | ## |
---|
10 | ## Author : Peter A. Buhr |
---|
11 | ## Created On : Sat May 16 08:05:18 2015 |
---|
12 | ## Last Modified By : Peter A. Buhr |
---|
13 | ## Last Modified On : Mon May 25 16:14:54 2015 |
---|
14 | ## Update Count : 7 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | INSTALL=@INSTALL@ |
---|
18 | BACKEND_CC := @BACKEND_CC@ |
---|
19 | CFA_LIBDIR = @CFA_LIBDIR@ |
---|
20 | |
---|
21 | LIBRARIES := libcfa.a |
---|
22 | |
---|
23 | all : ${LIBRARIES} builtins.cf Makefile |
---|
24 | |
---|
25 | install : all |
---|
26 | ${INSTALL} -d @CFA_LIBDIR@ |
---|
27 | ${INSTALL} prelude.cf @CFA_LIBDIR@ |
---|
28 | ${INSTALL} libcfa.a @CFA_LIBDIR@ |
---|
29 | |
---|
30 | # make forward declarations for gcc builtins |
---|
31 | builtins.cf : builtins.c |
---|
32 | if [ -e builtins.c ] ; 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 | ${INSTALL} builtins.cf @CFA_LIBDIR@ |
---|
36 | |
---|
37 | builtins.c : builtins.def prototypes.awk |
---|
38 | if [ -e builtins.def ] ; then \ |
---|
39 | @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \ |
---|
40 | fi |
---|
41 | |
---|
42 | builtins.def : |
---|
43 | |
---|
44 | libcfa-prelude.c : @CFA_LIBDIR@/cfa-cpp prelude.cf builtins.cf |
---|
45 | sed -i -e "s#typedef.*ptrdiff_t.*#`@BACKEND_CC@ -E ptrdiff_t.c | grep 'typedef.*ptrdiff_t'`#" prelude.cf |
---|
46 | @CFA_LIBDIR@/cfa-cpp -l prelude.cf $@ |
---|
47 | rm -f prelude.c |
---|
48 | |
---|
49 | libcfa-prelude.o : libcfa-prelude.c |
---|
50 | ${BACKEND_CC} -c -o $@ $< |
---|
51 | |
---|
52 | libcfa.a : libcfa-prelude.o |
---|
53 | ar crs $@ $^ |
---|
54 | |
---|
55 | EXTRA_OUTPUT += libcfa-prelude.o libcfa-prelude.c |
---|
56 | |
---|
57 | # clean-up rule |
---|
58 | clean : |
---|
59 | rm -f ${LIBRARIES} ${EXTRA_OUTPUT} |
---|
60 | |
---|
61 | distclean : clean |
---|