-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
125 lines (98 loc) · 3.24 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
PROJECT=lide.device
BUILDDIR=build
ROM=lide.rom
VERSION := $(shell git describe --tags --dirty | sed -r 's/^Release-//')
GIT_REF := "$(shell git branch --show-current)-$(shell git rev-parse --short HEAD)"
BUILD_DATE := $(shell date +"%d.%m.%Y")
CC=m68k-amigaos-gcc
CFLAGS+=-nostartfiles -nostdlib -noixemul -mcpu=68000 -Wall -Wno-multichar -Wno-pointer-sign -Wno-attributes -Wno-unused-value -s -Os -fomit-frame-pointer -DCDBOOT=1 -DNO_RDBLAST=1
CFLAGS+=-DGIT_REF=$(GIT_REF) -DBUILD_DATE=$(BUILD_DATE)
LDFLAGS=-lamiga -lgcc -lc
AS=m68k-amigaos-as
ifneq ($(VERSION),)
DISK=lide-update-$(VERSION).adf
else
DISK=lide-update.adf
endif
ifdef DEBUG
CFLAGS+= -DDEBUG=$(DEBUG)
LDFLAGS+= -ldebug
.PHONY: $(PROJECT)
endif
ifdef NOTIMER
CFLAGS+= -DNOTIMER=1
.PHONY: $(PROJECT)
endif
ifdef SLOWXFER
CFLAGS+= -DSLOWXFER=1
.PHONY: $(PROJECT)
endif
LDFLAGS+= -lnix13
.PHONY: clean all lideflash disk lha rename/renamelide lidetool/lidetool
all: $(ROM) \
lideflash \
rename/renamelide \
lide-N2630-high.rom \
lide-N2630-low.rom
OBJ = driver.o \
ata.o \
atapi.o \
scsi.o \
idetask.o \
mounter.o \
debug.o
ASMOBJ = endskip.o
SRCS = $(OBJ:%.o=%.c)
SRCS += $(ASMOBJ:%.o=%.S)
$(PROJECT): $(SRCS)
${CC} -o $@ $(CFLAGS) $(SRCS) $(LDFLAGS)
$(ROM): $(PROJECT)
make -C bootrom
lideflash/lideflash:
make -C lideflash
lideflash: lideflash/lideflash
lidetool/lidetool:
make -C lidetool
rename/renamelide:
make -C rename
lideflash/bootblock/obj/bootblock.o:
make -C lideflash/bootblock
disk: $(ROM) lideflash/lideflash rename/renamelide lidetool/lidetool lideflash/bootblock/obj/bootblock.o
@mkdir -p $(BUILDDIR)
cp $(ROM) build
echo -n 'lideflash -I $(ROM)\n' > $(BUILDDIR)/startup-sequence
xdftool $(BUILDDIR)/$(DISK) format lide-update + \
boot write lideflash/bootblock/obj/bootblock.o + \
write $(ROM) + \
write lidetool/lidetool lidetool + \
write lideflash/lideflash lideflash + \
write rename/renamelide renamelide + \
makedir s + \
write $(BUILDDIR)/startup-sequence s/startup-sequence + \
makedir Expansion + \
write info/Expansion.info Expansion.info + \
write info/lide.device.info Expansion/lide.device.info + \
write lide.device Expansion/lide.device
$(BUILDDIR)/lide-update.lha: lideflash/lideflash $(ROM) rename/renamelide lidetool/lidetool lide.device info/lide.device.info
@mkdir -p $(BUILDDIR)
cp $^ $(BUILDDIR)
cd $(BUILDDIR) && lha -c ../$@ $(notdir $^)
lha: $(BUILDDIR)/lide-update.lha
lide-N2630-high.rom: $(ROM)
srec_cat lide-word.rom -binary -split 2 0 1 -out $@ -binary
lide-N2630-low.rom: $(ROM)
srec_cat lide-word.rom -binary -split 2 1 1 -out $@ -binary
lide-tk-29F010.rom: $(ROM)
@cat lide-atbus.rom lide-atbus.rom lide-atbus.rom lide-atbus.rom > $@
lide-tk-29F020.rom: lide-tk-29F010.rom
@cat $< $< > $@
lide-tk-29F040.rom: lide-tk-29F020.rom
@cat $< $< > $@
clean:
-rm $(PROJECT)
make -C bootrom clean
make -C lideflash clean
make -C rename clean
-rm -rf *.rom
-rm -rf $(BUILDDIR)
make -C lideflash/bootblock clean