Use llvmc to compile the Stacker programs
[oota-llvm.git] / projects / Stacker / samples / Makefile
1 ##===- projects/sample/Makefile ----------------------------*- Makefile -*-===##
2 #
3 # This is a sample Makefile for a project that uses LLVM.
4 #
5 ##===----------------------------------------------------------------------===##
6
7 #
8 # Indicates our relative path to the top of the project's root directory.
9 #
10 LEVEL = ../../..
11
12 #
13 # Directories that needs to be built.
14 #
15 DIRS = 
16
17 SAMPLES = fibonacci hello prime
18
19 LLVMC_EXEC = $(TOOLDIR)/llvmc
20
21 all :: $(SAMPLES)
22
23 ifdef OPTIMIZE
24 % : %.st 
25         @$(ECHO) "Compiling and Optimizing $(<F)"
26         $(VERB)$(LLVMC_EXEC) -O3 $< -o $@
27 else
28 % : %.st
29         @$(ECHO) "Compiling $(<F)"
30         $(VERB)$(LLVMC_EXEC) $< -o $@
31 endif
32
33 SAMPLES_LL = $(SAMPLES:%=%.ll)
34 SAMPLES_BC = $(SAMPLES:%=%.bc)
35 SAMPLES_S  = $(SAMPLES:%=%.s)
36
37 clean ::
38         $(VERB)rm -f gmon.out $(SAMPLES)
39 #
40 # Include the Master Makefile that knows how to build all.
41 #
42 include $(LEVEL)/Makefile.common