summaryrefslogtreecommitdiff
path: root/projects/Stacker/samples/Makefile
blob: d5b278061cc1bdc65c21dcc38cc10969221eb9d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
##===- projects/sample/Makefile ----------------------------*- Makefile -*-===##
#
# This is a sample Makefile for a project that uses LLVM.
#
##===----------------------------------------------------------------------===##

#
# Indicates our relative path to the top of the project's root directory.
#
LEVEL = ../../..
DIRS = 

EXTRA_DIST = fibonacci.st hello.st prime.st goof.st

SAMPLES = fibonacci hello prime goof

LLVMC_EXEC = LLVM_CONFIG_DIR=$(BUILD_SRC_ROOT)/tools/llvmc $(TOOLDIR)/llvmc

all :: $(SAMPLES)

ifdef OPTIMIZE
% : %.st 
	@$(ECHO) "Compiling and Optimizing $(<F)"
	$(VERB)$(LLVMC_EXEC) -O3 $< -o $@
else
% : %.st
	@$(ECHO) "Compiling $(<F)"
	$(VERB)$(LLVMC_EXEC) $< -o $@
endif

SAMPLES_LL = $(SAMPLES:%=%.ll)
SAMPLES_BC = $(SAMPLES:%=%.bc)
SAMPLES_S  = $(SAMPLES:%=%.s)

clean ::
	$(VERB)rm -f gmon.out $(SAMPLES)
#
# Include the Master Makefile that knows how to build all.
#
include $(LEVEL)/Makefile.common