blob: 999f7c0cd9961fdd424aafb6d4c9a3192664851a [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
Brian Gaeke3e4a2712003-11-24 02:57:25 +000017SAMPLES = fibonacci hello prime
Chris Lattner9d014e72003-11-23 17:55:19 +000018
Reid Spencere198cd12004-10-28 04:08:05 +000019LLVMC_EXEC = $(TOOLDIR)/llvmc
Chris Lattner0c82ee72003-12-08 07:08:00 +000020
Brian Gaeke3e4a2712003-11-24 02:57:25 +000021all :: $(SAMPLES)
Chris Lattner9d014e72003-11-23 17:55:19 +000022
23ifdef OPTIMIZE
Reid Spencer6cb21d42004-10-27 23:18:45 +000024% : %.st
Reid Spencere198cd12004-10-28 04:08:05 +000025 @$(ECHO) "Compiling and Optimizing $(<F)"
26 $(VERB)$(LLVMC_EXEC) -O3 $< -o $@
Chris Lattner9d014e72003-11-23 17:55:19 +000027else
Reid Spencere198cd12004-10-28 04:08:05 +000028% : %.st
29 @$(ECHO) "Compiling $(<F)"
30 $(VERB)$(LLVMC_EXEC) $< -o $@
Chris Lattner9d014e72003-11-23 17:55:19 +000031endif
32
Brian Gaeke3e4a2712003-11-24 02:57:25 +000033SAMPLES_LL = $(SAMPLES:%=%.ll)
34SAMPLES_BC = $(SAMPLES:%=%.bc)
35SAMPLES_S = $(SAMPLES:%=%.s)
36
37clean ::
Reid Spencere198cd12004-10-28 04:08:05 +000038 $(VERB)rm -f gmon.out $(SAMPLES)
Chris Lattner9d014e72003-11-23 17:55:19 +000039#
40# Include the Master Makefile that knows how to build all.
41#
42include $(LEVEL)/Makefile.common