blob: ff3d01a2e2e6a19689feee0476262da7b518a3f1 [file] [log] [blame]
Brian Gaekeddc1aaa2004-10-05 18:05:25 +00001##===- examples/BFtoLLVM/tests/Makefile --------------------*- Makefile -*-===##
2#
3# The LLVM Compiler Infrastructure
4#
5# This file was developed by the LLVM research group and is distributed under
6# the University of Illinois Open Source License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9
10# Makefile for bf2llvm tests.
11
12LEVEL = ../../..
13BFTOLLVM = $(LLVMTOOLCURRENT)/BFtoLLVM
14
15include $(LEVEL)/Makefile.common
16
17all:: check
18
19clean::
20 rm -rf Output
21
22.SUFFIXES: .ll .gccas.bc .llvm .cbe.c .cbe
23
24Output/%.ll: %.b $(BFTOLLVM) Output/.dir
25 $(BFTOLLVM) $< $@
26
27Output/%.gccas.bc: Output/%.ll Output/.dir
28 $(LGCCAS) $< -o $@
29
30Output/%.llvm Output/%.llvm.bc: Output/%.gccas.bc Output/.dir
31 $(LGCCLD) $< -lc -lcrtend -o Output/$*.llvm
32
33Output/%.cbe.c: Output/%.llvm.bc Output/.dir
34 $(LLC) -march=c -f -o=$@ $<
35
36Output/%.cbe: Output/%.cbe.c Output/.dir
37 $(CC) -O2 $< -o $@
38
39check: Output/hello.cbe hello.expected-out
40 @echo "Running test"
41 Output/hello.cbe > Output/hello.out-cbe
42 @echo "Checking result"
43 diff Output/hello.out-cbe hello.expected-out
44 @echo "Test passed"
45