-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
77 lines (62 loc) · 1.85 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
#
# This program is built with gcc. Make sure it is in your path before
# typing make. Example:
# PATH=$PATH:/opt/amiga-gcc/bin
# make
#
PROGS := sdmac
VER ?= 0.9+
#VER := $(shell awk '/\$$VER:/{print $$7}' sdmac.c)
ADF_FILE := sdmac_$(VER).adf
ZIP_FILE := sdmac_$(VER).zip
LHA_FILE := sdmac_$(VER).lha
ARC_DIR := sdmac_$(VER)
CC := m68k-amigaos-gcc
CFLAGS := -Wall -Wno-pointer-sign -Os -DVER=\"$(VER)\"
CFLAGS += -fomit-frame-pointer
# clib2 crashes on exit under Kickstart 2.x
#LDFLAGS = -Xlinker [email protected] -Wa,-a > [email protected] -mcrt=clib2
LDFLAGS = -Xlinker [email protected] -Wa,-a > [email protected] -noixemul
#CFLAGS += -g
#LDFLAGS += -g
ifeq (, $(shell which $(CC) 2>/dev/null ))
$(error "No $(CC) in PATH: maybe do PATH=$$PATH:/opt/amiga/bin to set up")
endif
ifeq (, $(shell which xdftool 2>/dev/null ))
$(error "No xdftool in PATH: build and install amitools first: https://github.com/cnvogelg/amitools")
endif
all: $(PROGS)
sdmac: sdmac.c
$(PROGS): Makefile
$(CC) $(CFLAGS) $(filter %.c,$^) -o $@ $(LDFLAGS)
zip: $(ZIP_FILE)
lha: $(LHA_FILE)
$(ZIP_FILE): $(PROGS) README.md LICENSE
rm -rf $(ARC_DIR)
mkdir $(ARC_DIR)
cp -p $^ $(ARC_DIR)/
rm -f $@
zip -r $@ $(ARC_DIR)
rm -rf $(ARC_DIR)
$(LHA_FILE): $(PROGS) README.md LICENSE
rm -rf $(ARC_DIR)
mkdir $(ARC_DIR)
cp -p $^ $(ARC_DIR)/
rm -f $@
lha a $@ $(ARC_DIR)
rm -rf $(ARC_DIR)
adf: $(PROGS)
echo $(ADF_FILE)
xdftool $(ADF_FILE) format "AmigaSDMAC"
xdftool $(ADF_FILE) makedir C
xdftool $(ADF_FILE) makedir S
xdftool $(ADF_FILE) makedir Devs
xdftool $(ADF_FILE) write sdmac C/sdmac
xdftool $(ADF_FILE) write disk/Startup-Sequence S/Startup-Sequence
xdftool $(ADF_FILE) write disk/system-configuration Devs/system-configuration
xdftool $(ADF_FILE) write disk/Disk.info
xdftool $(ADF_FILE) write README.md
xdftool $(ADF_FILE) write LICENSE
xdftool $(ADF_FILE) boot install
clean:
rm $(PROGS)