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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [application/] [shc_clock/] [Makefile] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 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 -g -Os $(INCLUDES) -Wall
29
CFLAGS = -m2 -Os $(INCLUDES) -Wall
30
 
31
LDSCRIPT = startup/sh.x
32
 
33
LDFLAGS = -m2 -T $(LDSCRIPT) -O3 -nostartfiles -Wl,-Map,$(MAP_FILE)
34
 
35
#------------
36
# Input Files
37
#------------
38
STARTUP = crt0.S
39
LIBS =
40
SRCS = main.c
41
OBJS = $(STARTUP:.S=.o) $(LIBS:.c=.o) $(SRCS:.c=.o)
42
 
43
#---------------
44
# Make Operation
45
#---------------
46
$(TARGET) : $(TARGET_ELF)
47
        $(OBJCOPY) -v -O $(OUTPUT_FORMAT) $(TARGET_ELF) $(TARGET)
48
 
49
$(TARGET_ELF) : $(OBJS)
50
        $(CC) $(LDFLAGS) $(OBJS) -o $(TARGET_ELF)
51
        $(SIZE) -Ax $(TARGET_ELF)
52
 
53
$(OBJS) : Makefile
54
 
55
clean :
56
        rm -f *.o $(TARGET) $(TARGET_ELF) $(MAP_FILE)
57
 
58
%.o : %.c
59
        $(CC) -c $(CFLAGS) $<
60
 
61
%.o : %.S
62
        $(CC) -c $(CFLAGS) $<
63
 
64
%.o : %.s
65
        $(CC) -c $(CFLAGS) $<
66
 
67
#-------------------
68
# Header and Startup
69
#-------------------
70
vpath %.h ./include
71
vpath %.S ./startup
72
 
73
#------------------
74
# Source and Object
75
#------------------
76
main.o : main.c

powered by: WebSVN 2.1.0

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