blob: 2082d72ac1308625ee72cddbf5ee9bbb02c4a80e [file] [log] [blame]
Chris Lattner9d014e72003-11-23 17:55:19 +00001##===- 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#
10LEVEL = ../../..
11
12#
13# Directories that needs to be built.
14#
15DIRS =
16
17TESTS = fibonacci hello prime
18
19all :: $(TESTS)
20
21ifdef OPTIMIZE
22%.bc : %.st
23 stkrc -e -o - $< | opt -stats -q -f -o $*.bc \
24 -aa-eval -adce -branch-combine -cee -constmerge -constprop -dce -die -ds-aa \
25 -ds-opt -gcse -globaldce -indvars -inline -instcombine \
26 -ipconstprop -licm -loopsimplify -mem2reg -pre -sccp -simplifycfg \
27 -tailcallelim -verify
28else
29%.bc : %.st
30 stkrc -e -f -o $*.bc $<
31endif
32
33%.s : %.bc
34 llc -f -o $*.s $<
35
36% : %.s
37 gcc -g -L$(BUILD_OBJ_ROOT)/lib/Debug -lstkr_runtime -o $* $*.s
38
39%.ll : %.bc
40 llvm-dis -f -o $*.ll $<
41
42%.bc : $(BUILD_OBJ_ROOT)/tools/Debug/stkrc
43
44.PRECIOUS: %.bc %.s %.ll %.st
45#
46# Include the Master Makefile that knows how to build all.
47#
48include $(LEVEL)/Makefile.common