1: #
2: # ----------------------------------------------------------------------
3: # T-Kernel 2.0 Software Package
4: #
5: # Copyright 2011 by Ken Sakamura.
6: # This software is distributed under the latest version of T-License 2.x.
7: # ----------------------------------------------------------------------
8: #
9: # Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
10: # Modified by T-Engine Forum at 2013/03/02.
11: # Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
12: #
13: # ----------------------------------------------------------------------
14: #
15:
16: #
17: # Makefile (common description)
18: #
19: # RomInfo / SYSCONF / DEVCONF
20: #
21:
22: # source file dependencies (generated automatically)
23: DEPS = Dependencies
24: DEPENDENCIES_OUTPUT := $(DEPS)
25:
26: # source file path
27: S = ../../src/sysdepend/$(TETYPE)_$(MACHINE)
28: VPATH += $(S)
29:
30: # generate C source from configuration file
31: define CONV_CONF
32: echo '$< -> $@'
33: $(PERL) -e ' \
34: chop($$source = `basename $<`); \
35: print "#include <basic.h>\n"; \
36: print "EXPORT UB $$source [] = {\n"; \
37: while ( <> ) { \
38: chop; \
39: s/#.*$$//; \
40: s/\s{2,}/ /g; \
41: s/\s$$//g; \
42: print "\t\"$$_\\n\"\n" unless /^$$/; \
43: } \
44: print "};\n"; \
45: '
46: endef
47:
48: # ----------------------------------------------------------------------------
49:
50: .PHONY: all clean install
51:
52: ALL = rominfo-rom.mot rominfo-ram.mot
53:
54: all: $(ALL) install
55:
56: %.mot: %
57: $(OBJCOPY) $(OUTPUT_SREC) $< $@
58:
59: rominfo-rom: rominfo_rom.o sysconf.o devconf.o
60: $(LINK.o) -nostdlib -T rominfo$(_GCCVER).lnk $^ $(OUTPUT_OPTION)
61:
62: rominfo-ram: rominfo_ram.o launch.o sysconf.o devconf.o
63: $(LINK.o) -nostdlib -T rominfo$(_GCCVER).lnk $^ $(OUTPUT_OPTION)
64:
65: sysconf.c: $(S)/SYSCONF; @$(CONV_CONF) $< > $@
66: devconf.c: $(S)/DEVCONF; @$(CONV_CONF) $< > $@
67:
68: clean:
69: $(RM) $(ALL) rominfo-rom rominfo-ram
70: $(RM) rominfo_rom.o rominfo_ram.o launch.o
71: $(RM) sysconf.[co] devconf.[co] $(DEPS)
72:
73: install: $(addprefix $(EXE_INSTALLDIR)/, $(ALL))
74:
75: # generate dependencies
76: $(DEPS): ; touch $(DEPS)
77: -include $(DEPS)