forked from ytmytm/c64-lng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·167 lines (130 loc) · 4.37 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# compile switches:
# =================
# look into the machine specific config.h for details on compile switches.
# (eg. kernel/c64/config.h)
COMPFLAGS=
# selection of target machine
# ===========================
#
# MACHINE=c64 to create Commodore64 version (binaries in bin64)
# MACHINE=c128 for Commodore128 version (binaries in bin128)
# MACHINE=atari for Atari 65XE/800/130 version (no binaries right now)
MACHINE=c64
# Modules to include in package (created with "make package")
MODULES=sswiftlink sfifo64 rs232std swiftlink fifo64
# Applications to include in package
# the applications (in binary form) do not depend on the machine selection
APPS=getty lsmod microterm ps sh sleep testapp wc cat tee uuencode \
uudecode 232echo 232term kill rm ls buf cp uptime time meminfo \
strminfo uname more beep help env date ciartc dcf77 smwrtc \
hextype clear true false echo touch expand \
b-co b-cs ide64rtc cd pwd
# Test Applications
TAPPS=amalloc
# Scripts
SAPPS=dir man hello.sh sysinfo sysinfo.sh
# Internet Applications
# will be put in the same package als APPS now, but may go into a
# seperate one, in case the APP-package grows to big
IAPPS=connd ftp tcpipstat tcpip ppp loop slip httpd telnet popclient
#============== end of configurable section ============================
.PHONY : all apps kernel libstd help package clean distclean devel
export PATH+=:$(PWD)/devel_utils/:$(PWD)/devel_utils/atari:.
export LUPO_INCLUDEPATH=:$(PWD)/kernel:$(PWD)/include
export LNG_LIBRARIES=$(PWD)/lib/libstd.a
export COMPFLAGS
export MACHINE
ifeq "$(MACHINE)" "atari"
BINDIR=binatari
else
BINDIR=$(patsubst c%,bin%,$(MACHINE))
endif
ifeq "$(MACHINE)" "atari"
all : kernel
else
all : kernel libstd apps help
endif
apps : devel kernel libstd
$(MAKE) -C apps
samples : devel libstd
-$(MAKE) -C samples
kernel : devel
-rm -f include/config.h
$(MAKE) -C kernel
libstd : devel
$(MAKE) -C lib
help :
$(MAKE) -C help
devel :
$(MAKE) -C devel_utils
$(MAKE) -C devel_utils/atari
$(MAKE) -C devel_utils/apple
binaries: all
-mkdir $(BINDIR)
-cp kernel/boot.$(MACHINE) kernel/lunix.$(MACHINE) $(MODULES:%=kernel/modules/%) $(BINDIR)
cbmpackage : binaries
-mkdir pkg
cd $(BINDIR) ; mksfxpkg $(MACHINE) ../pkg/core.$(MACHINE) \
"*loader" boot.$(MACHINE) lunix.$(MACHINE) $(MODULES)
cd apps ; mksfxpkg $(MACHINE) ../pkg/apps.$(MACHINE) $(APPS) $(IAPPS)
cd help ; mksfxpkg $(MACHINE) ../pkg/help.$(MACHINE) *.html
cd scripts ; mksfxpkg $(MACHINE) ../pkg/scripts.$(MACHINE) $(SAPPS)
@echo "The following may fail"
-cd samples ; \
cp luna/skeleton ca65/skeleton.o65 cc65/hello . ; \
mksfxpkg $(MACHINE) ../pkg/samples.$(MACHINE) skeleton skeleton.o65 hello ; \
rm skeleton skeleton.o65 hello
ataripackage: binaries
makeimage $(BINDIR)/boot.$(MACHINE) $(BINDIR)/lunix.$(MACHINE) $(BINDIR)/atari.bin
cp $(BINDIR)/atari.bin pkg
ataridisc: binaries
makeatr lng-$(MACHINE).atr $(BINDIR)/atari.bin
cbmdisc: binaries
echo creating LUnix disc image for $(MACHINE)
c1541 -format lunix,00 d64 lunix-$(MACHINE).d64 > /dev/null
cd $(BINDIR); for i in \
loader fasthead fastloader \
boot.$(MACHINE) lunix.$(MACHINE) $(MODULES) \
; do c1541 -attach ../lunix-$(MACHINE).d64 -write $$i > /dev/null \
; done
cd kernel; for i in \
lunixrc \
; do c1541 -attach ../lunix-$(MACHINE).d64 -write $$i .$$i > /dev/null \
; done
cd apps; for i in \
$(APPS) $(IAPPS) $(TAPPS) \
; do c1541 -attach ../lunix-$(MACHINE).d64 -write $$i > /dev/null \
; done
cd help; for i in \
*.html \
; do c1541 -attach ../lunix-$(MACHINE).d64 -write $$i > /dev/null \
; done
cd scripts; for i in \
$(SAPPS) \
; do c1541 -attach ../lunix-$(MACHINE).d64 -write $$i > /dev/null \
; done
ifeq "$(MACHINE)" "atari"
disc: ataridisc
package: ataripackage
else
disc: cbmdisc
package: cbmpackage
endif
clean :
$(MAKE) -C kernel clean
$(MAKE) -C apps clean
$(MAKE) -C lib clean
$(MAKE) -C help clean
$(MAKE) -C samples clean
distclean : clean
$(MAKE) -C kernel distclean
$(MAKE) -C devel_utils clean
$(MAKE) -C devel_utils/atari clean
$(MAKE) -C devel_utils/apple clean
-cd kernel ; rm -f boot.c* lunix.c* globals.txt
-cd bin64 ; rm -f $(MODULES) boot.* lunix.* lng.c64
-cd bin128 ; rm -f $(MODULES) boot.* lunix.* lng.c128
-cd include ; rm -f jumptab.h jumptab.ca65.h ksym.h zp.h
-rm -rf pkg binatari
find . -name "*~" -exec rm -v \{\} \;
find . -name "#*" -exec rm -v \{\} \;