4 #---------- general definitions etc. ----------
6 TARGETS += $(foreach i, $(PICNOS), idlocs$i.hex noncode$i.hex)
7 MORSE_INCLUDE ?= common.inc
8 INCLUDES += ../iwjpictest/insn-aliases.inc morse+auto.inc
10 INCLUDES += $(addsuffix +vars.fin, $(VARSFILES))
11 INCLUDES += $(addsuffix +vars.inc, $(VARSFILES))
13 include ../common.make
16 #---------- bizarre macro arrangements for $(PROGRAMS) ----------
20 TARGETS += $(1)+code.hex $(1)+program.hex $(1)+program.map $(1)+program.disasm
21 TARGETS += $$(foreach i, $$(PICNOS), $(1)+entire$$i.hex)
23 $(1)_CODEHEX= $$(foreach panel, $$(XCODEN_$(1)), $(1)+$$(panel).hex) \
24 $$(foreach panel, $$(XCODE1_$(1)), $$(panel).hex)
26 $(1)+code.hex: $$(HEXMERGER) $(1)+program.hex $$($(1)_CODEHEX)
29 $(1)+entire%.hex: $$(HEXMERGER) $(1)+program.hex $$($(1)_CODEHEX) idlocs%.hex config.hex
32 $(1)+program.hex: $(1).o $$(OBJS_$(prog)) $$(LIBS)
37 define define_directasm
39 $(1).hex: $(1).asm $$(INCLUDES)
43 define makesubmakefile
44 set -e; d=.submakefile.new; rm -f $$d; for f in "$$@";do echo "$$f" >>$$d; done
46 $(foreach prog, $(PROGRAMS), $(call define_prog,$(prog)))
47 $(foreach da, idlocs% config %+morse %+pindata blank%,
48 $(call define_directasm,$(da)))
51 .submakefile: $(CEBPIC)manypics.make Makefile
52 : $(shell $(makesubmakefile)) ... generate .submakefile
55 ifneq ($(MAKECMDGOALS),clean)
59 blank0.asm blank2.asm blank4.asm blank6.asm: blank%.asm: $(CEBPIC)manypics.make
60 echo >$@.new " org 0x$*000"
65 #---------- targets ----------
69 noncode%.hex: $(HEXMERGER) idlocs%.hex config.hex
72 morse+auto.inc: $(CEBPIC)morse-generator morse.messages
75 %+vars.inc: %.asm $(CEBPIC)manypics.make
77 BEGIN { print "; autogenerated - do not edit\n"; } \
78 next unless m/^\w+\s+equ\s+/; \
79 print $$_ or die $$!; \
82 %+vars.fin: %.asm $(CEBPIC)manypics.make
84 BEGIN { print "; autogenerated - do not edit\n"; } \
85 next unless m/^(\w+)\s/; \
86 next if m/^\w+\s+(?:equ|udata|udata_acs)\s+/; \
87 print " extern $$1\n" or die $$!; \
90 %+morse.asm: $(CEBPIC)morse-generator morse.messages %+program.map
91 ./$^ asm -I$(MORSE_INCLUDE) $o
96 idlocs%.asm: $(CEBPIC)make-idlocs ../layout/ours.wiring
97 ./$^ $* >$@.new && mv -f $@.new $@
99 ours+pindata.asm: ../layout/ours+pindata.asm
102 manypic-clean: pic-clean
103 rm -f idlocs*.asm *+morse.* morse+auto.inc blank[0246].*
105 .PRECIOUS: idlocs%.asm morse+auto.inc %+morse.asm %+morse.hex %.map
106 .PRECIOUS: %+vars.inc %+vars.fin