-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (39 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
######################################################################
# MieruEMB System V1.0 2011-10-01 Arch Lab. TOKYO TECH
######################################################################
TARGET = init
OBJS = startup.o main.o
CMDPREF = ../mipsel-emb/usr/bin/
#CMDPREF = /usr/local/mipsel-emb/usr/bin/
#CMDPREF = /home/share/cad/mipsel-emb/usr/bin/
#CMDPREF = /home/share/cad/mipsel/usr/bin/
MIPSCC = $(CMDPREF)mipsel-linux-gcc
MIPSAS = $(CMDPREF)mipsel-linux-as
MIPSLD = $(CMDPREF)mipsel-linux-ld
OBJDUMP = $(CMDPREF)mipsel-linux-objdump
MEMGEN = ../mipsel-emb/bin/memgen
AFLAGS =
CFLAGS = -Wall -O2
LFLAGS =
.SUFFIXES:
.SUFFIXES: .o .c .S
######################################################################
all:
$(MAKE) clean
$(MAKE) $(TARGET)
$(MAKE) image
$(TARGET): $(OBJS)
$(MIPSLD) $(LFLAGS) -T stdld.script $(OBJS) -o $(TARGET)
.c.o:
$(MIPSCC) $(CFLAGS) -c $(@D)/$(<F) -o $(@D)/$(@F)
.S.o:
$(MIPSCC) $(AFLAGG) -c $(@D)/$(<F) -o $(@D)/$(@F)
image:
$(MEMGEN) -b $(TARGET) 512 > $(TARGET).bin
dump:
$(OBJDUMP) -D $(TARGET)
read:
readelf -a $(TARGET)
clean:
rm -f *.o *~ log.txt $(TARGET) $(TARGET).bin
######################################################################