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 submakefiletext
44 $(foreach prog, $(PROGRAMS), $(call define_prog,$(prog)))
45 $(foreach da, idlocs% config %+morse %+pindata blank%,
46 $(call define_directasm,$(da)))
48 export submakefiletext
50 $(eval $(submakefiletext))
52 blank0.asm blank2.asm blank4.asm blank6.asm: blank%.asm: $(CEBPIC)manypics.make
53 echo >$@.new " org 0x$*000"
58 #---------- targets ----------
62 noncode%.hex: $(HEXMERGER) idlocs%.hex config.hex
65 morse+auto.inc: $(CEBPIC)morse-generator morse.messages
68 %+vars.inc: %.asm $(CEBPIC)manypics.make
70 -e ' BEGIN { print "; autogenerated - do not edit\n"; } '\
71 -e ' next unless m/^\w+\s+equ\s+/; '\
72 -e ' print $$_ or die $$!; '\
75 %+vars.fin: %.asm $(CEBPIC)manypics.make
77 -e ' BEGIN { print "; autogenerated - do not edit\n"; } '\
78 -e ' next unless m/^(\w+)\s/; '\
79 -e ' next if m/^\w+\s+(?:equ|udata|udata_acs)\s+/; '\
80 -e ' print " extern $$1\n" or die $$!; '\
83 %+morse.asm: $(CEBPIC)morse-generator morse.messages %+program.map
84 ./$^ asm -I$(MORSE_INCLUDE) $o
89 idlocs%.asm: $(CEBPIC)make-idlocs ../layout/ours.wiring
90 ./$^ $* >$@.new && mv -f $@.new $@
92 ours+pindata.asm: ../layout/ours+pindata.asm
95 manypic-clean: pic-clean
96 rm -f idlocs*.asm *+morse.* morse+auto.inc blank[0246].*
98 .PRECIOUS: idlocs%.asm morse+auto.inc %+morse.asm %+morse.hex %.map
99 .PRECIOUS: %+vars.inc %+vars.fin