2003-11-23 17:55:19 +00:00
|
|
|
##===- 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 =
|
|
|
|
|
2004-10-28 06:42:34 +00:00
|
|
|
EXTRA_DIST = fibonacci.st hello.st prime.st goof.st
|
|
|
|
|
|
|
|
SAMPLES = fibonacci hello prime goof
|
2003-11-23 17:55:19 +00:00
|
|
|
|
2004-10-29 06:42:38 +00:00
|
|
|
LLVMC_EXEC = LLVM_CONFIG_DIR=$(BUILD_SRC_ROOT)/tools/llvmc $(TOOLDIR)/llvmc
|
2003-12-08 07:08:00 +00:00
|
|
|
|
2003-11-24 02:57:25 +00:00
|
|
|
all :: $(SAMPLES)
|
2003-11-23 17:55:19 +00:00
|
|
|
|
|
|
|
ifdef OPTIMIZE
|
2004-10-27 23:18:45 +00:00
|
|
|
% : %.st
|
2004-10-30 09:26:22 +00:00
|
|
|
$(Echo) "Compiling and Optimizing $(<F)"
|
|
|
|
$(Verb)$(LLVMC_EXEC) -O3 $< -o $@
|
2003-11-23 17:55:19 +00:00
|
|
|
else
|
2004-10-28 04:08:05 +00:00
|
|
|
% : %.st
|
2004-10-30 09:26:22 +00:00
|
|
|
$(Echo) "Compiling $(<F)"
|
|
|
|
$(Verb)$(LLVMC_EXEC) $< -o $@
|
2003-11-23 17:55:19 +00:00
|
|
|
endif
|
|
|
|
|
2003-11-24 02:57:25 +00:00
|
|
|
SAMPLES_LL = $(SAMPLES:%=%.ll)
|
|
|
|
SAMPLES_BC = $(SAMPLES:%=%.bc)
|
|
|
|
SAMPLES_S = $(SAMPLES:%=%.s)
|
|
|
|
|
|
|
|
clean ::
|
2004-10-30 09:26:22 +00:00
|
|
|
$(Verb)rm -f gmon.out $(SAMPLES)
|
2003-11-23 17:55:19 +00:00
|
|
|
#
|
|
|
|
# Include the Master Makefile that knows how to build all.
|
|
|
|
#
|
|
|
|
include $(LEVEL)/Makefile.common
|