forked from jaggies/coco3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJamrules
86 lines (69 loc) · 1.47 KB
/
Jamrules
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
TARGET = coco3 ;
OPTIM = -O2 ;
CPU = HD6309 ;
#DEFINES += DEBUG ;
if $(TARGET) = "coco3" {
#LWTOOLS
AR = lwar -car ;
AS = cmoc -c ;
RANLIB = echo ;
#CMOC
CC = cmoc ;
#LINK = lwlink ;
#CCFLAGS = --verbose ;
CCFLAGS += -DCOCO -Dconst= ;
CCFLAGS += --coco ; # Coco .bin file
CCFLAGS += --limit=7800 ; # protect stack
#CCFLAGS += -S ;
#CCFLAGS += --os9 ; # Coco OS9 executable
# Oops, emulators have faulty implementation of HD6309 MULD instruction
DEFINES += MULD_WAR ;
if $(CPU) = "HD6309" {
DEFINES += HD6309 ;
}
} else {
TARGET = $(OS) ;
}
ALL_LOCATE_TARGET = $(TOP)/build/$(TARGET) ;
LINK = $(CC) $(CCFLAGS) -L$(ALL_LOCATE_TARGET) ;
DECB = decb ; # coco disk builder
#
# Rule to create a disk
#
rule CoCoDisk
{
local _disk = $(<) ;
local _files = $(>) ;
MakeLocate $(<) : $(TOP)/build ;
CoCoDiskCreate $(_disk) ;
CoCoDiskFromFiles $(_disk) : $(_files) ;
}
#
# CocoDiskFromFiles <dskname> : <files>
#
rule CoCoDiskFromFiles
{
local _disk _files ;
# Add grist (absolute path) to file names
_files = $(>) ;
_disk = $(<) ;
# library depends on its member objects
Depends all : $(_disk) ; # Force disk to be built
# make library depend on objects
Depends $(_disk) : $(_files) ;
Clean clean : $(_l) ;
CoCoDiskCopy $(_disk) : $(_files) ;
}
rule CoCoDiskCreate
{
Depends all : $(<) ;
}
actions CoCoDiskCreate
{
rm -f $(<) ;
$(DECB) dskini $(<) ;
}
actions piecemeal CoCoDiskCopy
{
$(DECB) copy -2br $(>) $(<), ;
}