Makefile revision 8026:680f5c014bed
1# Copyright (c) 2003, 2004
2# The Regents of The University of Michigan
3# All Rights Reserved
4#
5# This code is part of the M5 simulator.
6#
7# Permission is granted to use, copy, create derivative works and
8# redistribute this software and such derivative works for any purpose,
9# so long as the copyright notice above, this grant of permission, and
10# the disclaimer below appear in all copies made; and so long as the
11# name of The University of Michigan is not used in any advertising or
12# publicity pertaining to the use or distribution of this software
13# without specific, written prior authorization.
14#
15# THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
16# UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
17# WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
18# IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
19# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
20# THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
21# INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
22# DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
23# WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
24# ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
25#
26# Authors: Nathan L. Binkert
27#          Ali G. Saidi
28
29# Makefile for palcode
30# Works on alpha-linux and builds elf executable
31
32### If we are not compiling on an alpha, we must use cross tools ###    
33ifneq ($(shell uname -m), alpha)
34CROSS_COMPILE?=alpha-unknown-linux-gnu-
35endif
36CC=$(CROSS_COMPILE)gcc
37AS=$(CROSS_COMPILE)as
38LD=$(CROSS_COMPILE)ld
39
40CFLAGS=-I . -I ../h -nostdinc -nostdinc++ -Wa,-m21164
41LDFLAGS=-Ttext 0x4000
42
43TLOBJS = osfpal.o platform_tlaser.o
44TLOBJS_COPY = osfpal_cache_copy.o platform_tlaser.o
45TLOBJS_COPY_UNALIGNED = osfpal_cache_copy_unaligned.o platform_tlaser.o
46TSOBJS = osfpal.o platform_tsunami.o
47TSBOBJS = osfpal.o platform_bigtsunami.o
48TSOBJS_COPY = osfpal_cache_copy.o platform_tsunami.o
49TSOBJS_COPY_UNALIGNED = osfpal_cache_copy_unaligned.o platform_bigtsunami.o
50
51all: tlaser tsunami tsunami_b64
52
53all_copy: tlaser tlaser_copy tsunami tsunami_b64 tsunami_copy
54
55osfpal.o: osfpal.S
56	$(CC) $(CFLAGS) -o $@ -c $<
57
58osfpal_cache_copy.o: osfpal.S
59	$(CC) $(CFLAGS) -DCACHE_COPY -o $@ -c $<
60
61osfpal_cache_copy_unaligned.o: osfpal.S
62	$(CC) $(CFLAGS) -DCACHE_COPY -DCACHE_COPY_UNALIGNED -o $@ -c $<
63
64platform_tlaser.o: platform.S
65	$(CC) $(CFLAGS) -DTLASER -o $@ -c $<
66
67platform_tsunami.o: platform.S
68	$(CC) $(CFLAGS) -DTSUNAMI -o $@ -c $<
69
70platform_bigtsunami.o: platform.S
71	$(CC) $(CFLAGS) -DBIG_TSUNAMI -o $@ -c $<
72
73tlaser:  $(TLOBJS)
74	$(LD) $(LDFLAGS) -o tl_osfpal $(TLOBJS)
75
76tlaser_copy: $(TLOBJS_COPY) $(TLOBJS_COPY_UNALIGNED)
77	$(LD) $(LDFLAGS) -o tl_osfpal_cache $(TLOBJS_COPY)
78	$(LD) $(LDFLAGS) -o tl_osfpal_unalign $(TLOBJS_COPY_UNALIGNED)
79
80tsunami: $(TSOBJS)
81	$(LD) $(LDFLAGS) -o ts_osfpal $(TSOBJS)
82
83tsunami_b64: $(TSBOBJS)
84	$(LD) $(LDFLAGS) -o tsb_osfpal $(TSBOBJS)
85
86tsunami_copy: $(TSOBJS_COPY) $(TSOBJS_COPY_UNALIGNED)
87	$(LD) $(LDFLAGS) -o ts_osfpal_cache $(TSOBJS_COPY)
88	$(LD) $(LDFLAGS) -o ts_osfpal_unalign $(TSOBJS_COPY_UNALIGNED)
89
90clean:
91	rm -f *.o tl_osfpal tl_osfpal_cache tl_osfpal_unalign ts_osfpal \
92	ts_osfpal_cache ts_osfpal_unalign tsb_osfpal
93