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 = ../../..
|
|
|
|
|
|
|
|
#
|
|
|
|
# Directories that needs to be built.
|
|
|
|
#
|
|
|
|
DIRS =
|
|
|
|
|
2003-11-24 02:57:25 +00:00
|
|
|
SAMPLES = fibonacci hello prime
|
2003-11-23 17:55:19 +00:00
|
|
|
|
2004-10-28 04:08:05 +00:00
|
|
|
LLVMC_EXEC = $(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-28 04:08:05 +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
|
|
|
|
@$(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-28 04:08:05 +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
|