OpenCores
URL https://opencores.org/ocsvn/Aquarius/Aquarius/trunk

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [application/] [shc_pi/] [Makefile] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 thorn_aitc
#========================================
2
# SuperH (SH-2) C Compiler Makefile
3
#----------------------------------------
4
#     Rev.1 March 21, 2003 by Thorn Aitch
5
#========================================
6
 
7
#-------------
8
# Command Path
9
#-------------
10
CMD_PATH = /usr/local/bin
11
CC = $(CMD_PATH)/sh-elf-gcc
12
OBJCOPY = $(CMD_PATH)/sh-elf-objcopy
13
SIZE = $(CMD_PATH)/sh-elf-size
14
 
15
#-------------
16
# Output Files
17
#-------------
18
TARGET = main.srec
19
TARGET_ELF = main.elf
20
MAP_FILE = $(TARGET_ELF:.elf=.map)
21
 
22
OUTPUT_FORMAT = srec --srec-forceS3
23
 
24
#-------------------------
25
# Compile and Link Options
26
#-------------------------
27
INCLUDES = -I./include
28
CFLAGS = -m2 -O1 $(INCLUDES) -Wall
29
 
30
LDSCRIPT = startup/sh.x
31
 
32
LDFLAGS = -m2 -T $(LDSCRIPT) -O3 -nostartfiles -Wl,-Map,$(MAP_FILE)
33
 
34
#------------
35
# Input Files
36
#------------
37
STARTUP = crt0.S
38
LIBS =
39
SRCS = main.c
40
OBJS = $(STARTUP:.S=.o) $(LIBS:.c=.o) $(SRCS:.c=.o)
41
 
42
#---------------
43
# Make Operation
44
#---------------
45
$(TARGET) : $(TARGET_ELF)
46
        $(OBJCOPY) -v -O $(OUTPUT_FORMAT) $(TARGET_ELF) $(TARGET)
47
 
48
$(TARGET_ELF) : $(OBJS)
49
        $(CC) $(LDFLAGS) $(OBJS) -o $(TARGET_ELF)
50
        $(SIZE) -Ax $(TARGET_ELF)
51
 
52
$(OBJS) : Makefile
53
 
54
clean :
55
        rm -f *.o $(TARGET) $(TARGET_ELF) $(MAP_FILE)
56
 
57
%.o : %.c
58
        $(CC) -c $(CFLAGS) $<
59
 
60
%.o : %.S
61
        $(CC) -c $(CFLAGS) $<
62
 
63
%.o : %.s
64
        $(CC) -c $(CFLAGS) $<
65
 
66
#-------------------
67
# Header and Startup
68
#-------------------
69
vpath %.h ./include
70
vpath %.S ./startup
71
 
72
#------------------
73
# Source and Object
74
#------------------
75
main.o : main.c

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.