[b87a5ed] | 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 | ##
|
---|
[843054c2] | 10 | ## Author : Richard C. Bilson
|
---|
[b87a5ed] | 11 | ## Created On : Sat May 16 08:37:37 2015
|
---|
| 12 | ## Last Modified By : Peter A. Buhr
|
---|
[843054c2] | 13 | ## Last Modified On : Thu May 21 21:17:32 2015
|
---|
| 14 | ## Update Count : 3
|
---|
[b87a5ed] | 15 | ###############################################################################
|
---|
[51b73452] | 16 |
|
---|
[b87a5ed] | 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
|
---|
[51b73452] | 20 | TARGET := cfa-cpp
|
---|
| 21 |
|
---|
[b87a5ed] | 22 | all: ${TARGET}
|
---|
[51b73452] | 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
|
---|
[b87a5ed] | 42 | include ${patsubst %,%/module.mk,${MODULES}}
|
---|
[51b73452] | 43 |
|
---|
| 44 | # determine the object files
|
---|
[b87a5ed] | 45 | OBJ := ${patsubst %.cc,%.o,${filter %.cc,${SRC}}} \
|
---|
| 46 | ${patsubst %.y,%.tab.o,${filter %.y,${SRC}}} \
|
---|
| 47 | ${patsubst %.l,%.yy.o,${filter %.l,${SRC}}}
|
---|
[51b73452] | 48 |
|
---|
| 49 | # include the C include dependencies
|
---|
[b87a5ed] | 50 | DEPS := ${OBJ:.o=.d}
|
---|
| 51 | -include ${DEPS}
|
---|
[51b73452] | 52 |
|
---|
| 53 | # link the program
|
---|
[b87a5ed] | 54 | ${TARGET}: ${OBJ}
|
---|
| 55 | ${PURIFY} ${CXX} -o $@ ${OBJ} ${LIBS}
|
---|
[51b73452] | 56 |
|
---|
| 57 | #installing
|
---|
[b87a5ed] | 58 | install: ${TARGET}
|
---|
| 59 | ${INSTALL} -d @CFA_LIBDIR@
|
---|
| 60 | ${INSTALL} ${TARGET} @CFA_LIBDIR@
|
---|
[51b73452] | 61 |
|
---|
| 62 | # clean-up rule
|
---|
| 63 | clean:
|
---|
[b87a5ed] | 64 | rm -f ${OBJ} ${DEPS} ${TARGET} tags ${EXTRA_OUTPUT}
|
---|
[51b73452] | 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
|
---|