2007-02-05 06:25:16 +08:00
|
|
|
#===-- projects/llvm-stacker/samples/Makefile ---------------*- Makefile -*-===#
|
2003-11-24 01:55:19 +08:00
|
|
|
#
|
2007-02-05 06:25:16 +08:00
|
|
|
# The LLVM Compiler Infrastructure
|
2003-11-24 01:55:19 +08:00
|
|
|
#
|
2007-02-05 06:25:16 +08:00
|
|
|
# This file was developed by Reid Spencer and is distributed under the
|
|
|
|
# University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
#===------------------------------------------------------------------------===#
|
2003-11-24 01:55:19 +08:00
|
|
|
#
|
2007-02-05 06:25:16 +08:00
|
|
|
# This makefile builds some sample stacker programs.
|
2003-11-24 01:55:19 +08:00
|
|
|
#
|
2007-02-05 06:25:16 +08:00
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
|
|
|
# Indicates our relative path to the top of the project's root directory.
|
2003-11-24 01:55:19 +08:00
|
|
|
LEVEL = ../../..
|
|
|
|
DIRS =
|
|
|
|
|
2004-10-28 14:42:34 +08:00
|
|
|
EXTRA_DIST = fibonacci.st hello.st prime.st goof.st
|
|
|
|
|
|
|
|
SAMPLES = fibonacci hello prime goof
|
2003-11-24 01:55:19 +08:00
|
|
|
|
2004-10-29 14:42:38 +08:00
|
|
|
LLVMC_EXEC = LLVM_CONFIG_DIR=$(BUILD_SRC_ROOT)/tools/llvmc $(TOOLDIR)/llvmc
|
2003-12-08 15:08:00 +08:00
|
|
|
|
2003-11-24 10:57:25 +08:00
|
|
|
all :: $(SAMPLES)
|
2003-11-24 01:55:19 +08:00
|
|
|
|
|
|
|
ifdef OPTIMIZE
|
2004-10-28 07:18:45 +08:00
|
|
|
% : %.st
|
2004-10-30 17:26:22 +08:00
|
|
|
$(Echo) "Compiling and Optimizing $(<F)"
|
|
|
|
$(Verb)$(LLVMC_EXEC) -O3 $< -o $@
|
2003-11-24 01:55:19 +08:00
|
|
|
else
|
2004-10-28 12:08:05 +08:00
|
|
|
% : %.st
|
2004-10-30 17:26:22 +08:00
|
|
|
$(Echo) "Compiling $(<F)"
|
|
|
|
$(Verb)$(LLVMC_EXEC) $< -o $@
|
2003-11-24 01:55:19 +08:00
|
|
|
endif
|
|
|
|
|
2003-11-24 10:57:25 +08:00
|
|
|
SAMPLES_LL = $(SAMPLES:%=%.ll)
|
|
|
|
SAMPLES_BC = $(SAMPLES:%=%.bc)
|
|
|
|
SAMPLES_S = $(SAMPLES:%=%.s)
|
|
|
|
|
|
|
|
clean ::
|
2004-10-30 17:26:22 +08:00
|
|
|
$(Verb)rm -f gmon.out $(SAMPLES)
|
2003-11-24 01:55:19 +08:00
|
|
|
#
|
|
|
|
# Include the Master Makefile that knows how to build all.
|
|
|
|
#
|
|
|
|
include $(LEVEL)/Makefile.common
|