-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.sub
More file actions
80 lines (57 loc) · 2.59 KB
/
Makefile.sub
File metadata and controls
80 lines (57 loc) · 2.59 KB
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
### ==========================================================================
### $Id: Makefile.sub 904 2009-05-13 11:00:45Z hoenicke $
### FILE: rom/Makefile.sub - build an open source ROM implementation
### bibo - another LEGO MindStorms RCX OS
### --------------------------------------------------------------------------
# rom source files
ROM_BASENAME?=foss-rom
ROM_BASESUBDIR?=rom
ROM_FILES_BASE?=$(ROM_BASESUBDIR)/$(ROM_BASENAME)
ROMSOURCE_FILES=
ROMSOURCE_PATHS=$(ROMSOURCE_FILES:%=$(ROM_BASESUBDIR)/%)
ROMASMSOURCE_FILES=$(ROM_BASENAME).s $(ROM_BASENAME)-lcd.s
ROMASMSOURCE_PATHS=$(ROMASMSOURCE_FILES:%=$(ROM_BASESUBDIR)/%)
# rom object files (foss-rom.s adn foss-rom-lcd.s produce only a single object file)
ROMOBJECTS=$(ROM_FILES_BASE).o
ROMLD_FILE=h8300-rcx-rom.ld
ROMLD_PATH=$(ROM_BASESUBDIR)/$(ROMLD_FILE)
ROM_FILE_TYPES=coff srec bin
ROM_FILES=$(ROM_FILE_TYPES:%=$(ROM_BASENAME).%)
ROM_PATHS=$(ROM_FILES:%=$(ROM_BASESUBDIR)/%)
ROM_TARGETS=$(ROM_PATHS)
# Files of the source distribution
DISTFILES += $(ROM_BASESUBDIR)/Makefile.sub $(ROMSOURCE_PATHS) $(ROMASMSOURCE_PATHS)
#
# NOTE: uncomment out the first line if you need a rom disassembly file.
# This will not work on Windows unless you have perl installed.
#
rom: $(ROM_TARGETS)
rom-clean:
cd $(ROM_BASESUBDIR) && rm -f *.o *.dis *.map *.d
rom-realclean: rom-clean
cd $(ROM_BASESUBDIR) && rm -f *~ *.bak *.tgz *.dcoff *.dmap *.dsrec
cd $(ROM_BASESUBDIR) && rm -f .srec *.coff *.bin install-stamp tags
rom-install: $(ROM_TARGETS)
test -d $(DESTDIR)$(pkgtargetkerneldir) || mkdir -p $(DESTDIR)$(pkgtargetkerneldir)
install -m 644 $(ROM_TARGETS) $(DESTDIR)$(pkgtargetkerneldir)
install -m 644 $(ROMLD_PATH) $(DESTDIR)$(pkgtargetkerneldir)
rom-uninstall:
cd $(DESTDIR)$(pkgtargetkerneldir) && rm -f $(notdir $(ROM_TARGETS)) $(notdir $(ROMLD_PATH))
.PHONY: all rom rom-clean rom-realclean rom-install rom-uninstall tag depend
##
## no user servicable parts below
##
# linker command files for rom
ROMLDFLAGS=-T $(ROMLD_PATH) -nostdlib -relax
############ rom stuff
# how to build rom object from assembly
$(ROM_FILES_BASE).o: $(ROM_FILES_BASE).s $(ROM_FILES_BASE)-lcd.s
$(CROSSAS) -I $(ROM_BASESUBDIR) -o $@ $<
# how to build coff rom (for symbols, disassembly etc)
$(ROM_FILES_BASE).coff: $(ROMOBJECTS) $(ROMLD_PATH)
$(CROSSLD) $(ROMLDFLAGS) $(ROMOBJECTS) -o $@
# dependencies
-include $(ROMSOURCE_PATHS:%.c=%.d)
### --------------------------------------------------------------------------
### End of FILE: rom/Makefile.sub
### ==========================================================================