1 | ######################### -*- 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 : Richard C. Bilson
|
---|
11 | ## Created On : Sat May 16 08:37:37 2015
|
---|
12 | ## Last Modified By : Peter A. Buhr
|
---|
13 | ## Last Modified On : Thu May 21 21:17:32 2015
|
---|
14 | ## Update Count : 3
|
---|
15 | ###############################################################################
|
---|
16 |
|
---|
17 | # This makefile is adapted from Peter Miller's article "Recursive Make Considered Harmful"
|
---|
18 |
|
---|
19 | MODULES := Common Parser SynTree SymTab ResolvExpr CodeGen ControlStruct GenPoly Tuples InitTweak Designators # Try ArgTweak Explain
|
---|
20 | TARGET := cfa-cpp
|
---|
21 |
|
---|
22 | all: ${TARGET}
|
---|
23 |
|
---|
24 | # look for include files in each of the modules
|
---|
25 | CXX := @CXX@
|
---|
26 | CXXFLAGS += -Wno-deprecated -Wall -g -DDEBUG_ALL -I. -I Common -MMD
|
---|
27 | INSTALL=@INSTALL@
|
---|
28 |
|
---|
29 | # this is the back-end compiler, used to compile libcfa & builtins to link with user code
|
---|
30 | BACKEND_CC := @BACKEND_CC@
|
---|
31 |
|
---|
32 | # extra libraries if required
|
---|
33 | LIBS :=
|
---|
34 |
|
---|
35 | # each module will add to this
|
---|
36 | SRC := main.cc MakeLibCfa.cc
|
---|
37 |
|
---|
38 | # other things that ought to be cleaned up
|
---|
39 | EXTRA_OUTPUT := core
|
---|
40 |
|
---|
41 | # include the description for each module
|
---|
42 | include ${patsubst %,%/module.mk,${MODULES}}
|
---|
43 |
|
---|
44 | # determine the object files
|
---|
45 | OBJ := ${patsubst %.cc,%.o,${filter %.cc,${SRC}}} \
|
---|
46 | ${patsubst %.y,%.tab.o,${filter %.y,${SRC}}} \
|
---|
47 | ${patsubst %.l,%.yy.o,${filter %.l,${SRC}}}
|
---|
48 |
|
---|
49 | # include the C include dependencies
|
---|
50 | DEPS := ${OBJ:.o=.d}
|
---|
51 | -include ${DEPS}
|
---|
52 |
|
---|
53 | # link the program
|
---|
54 | ${TARGET}: ${OBJ}
|
---|
55 | ${PURIFY} ${CXX} -o $@ ${OBJ} ${LIBS}
|
---|
56 |
|
---|
57 | #installing
|
---|
58 | install: ${TARGET}
|
---|
59 | ${INSTALL} -d @CFA_LIBDIR@
|
---|
60 | ${INSTALL} ${TARGET} @CFA_LIBDIR@
|
---|
61 |
|
---|
62 | # clean-up rule
|
---|
63 | clean:
|
---|
64 | rm -f ${OBJ} ${DEPS} ${TARGET} tags ${EXTRA_OUTPUT}
|
---|
65 | find . -name "Expected*" -prune -o \( -name "*.tst" -o -name "report" \) -print | xargs rm -f
|
---|
66 | find . -name "core*" -print | xargs rm -f
|
---|
67 |
|
---|
68 | distclean: clean
|
---|