# Makefile for schematics/ subsection of Ronja project # (c) 1998-2003 Karel 'Clock' Kulhavy .PHONY: clean_sch_pngs clean_small_sch_pngs clean_sch_ps clean_sch_phps SCHEMATICS_SMALLCOMMANDS= -gamma 0.45 -geometry 700x -gamma 2.2 SCHEMATIC_MODULES = metropolis_transmitter/metropolis_transmitter 10M_receiver \ aui aui_forte twister nebulus audiofire starquake hertz \ inferno_receiver replacement heating 10M_receiver_smd ua733 sniffer \ twister2/twister2 pinouts loopback crossover 2crossovers \ power_pinout cabling2 psychelectric rx_experimental exciter \ exciter_advanced vgalamp didaktik surfer rx_noise luxmeter pump \ mundaka SCHS=$(patsubst %, schematics/%, $(SCHEMATIC_MODULES)) $(SIM_MODS_SCHINCLUDED) LSCHS = $(SCHS:=_0) $(SCHS:=_1) SCH_PSS = $(LSCHS:=0.ps) $(LSCHS:=1.ps) $(LSCHS:=2.ps) clean_sch_ps: rm -f $(SCH_PSS) PSGZS = $(SCH_PSS:=.gz) SCH_PNGS = $(SCHS:=.png) $(SCHS:=_small.png) clean_sch_pngs: rm -f $(SCH_PNGS) clean_small_sch_pngs: rm -f $(SCHS:=_small.png) SCH_PDFS = $(SCH_PSS:.ps=.pdf) MULTIPLES_RAW=metropolis tetrapolis inferno benchpress rxtx rexlator MULTIPLES=$(patsubst %,schematics/%,$(MULTIPLES_RAW)) MULDULES=$(MULTIPLES) $(SCHS) CZPLISTS=$(SCHS:=_1_cz.html) $(SCHS:=_2_cz.html) $(MULDULES:=_3_cz.html) \ $(MULDULES:=_cz.csv) # Partlist roots PARTLISTS=$(SCHS:=_1.html) $(SCHS:=_2.html) $(MULDULES:=_3.html) \ $(SCHS:=.csv) $(CZPLISTS) $(MULTIPLES:=.csv) NETLISTS=$(SCHS:=_1.net) $(SCHS:=_2.net) $(MULTIPLES:=_2.net) GENERATED+=$(SCH_PNGS) $(SCHS:=.php) $(SCHS:=_1.net) $(PARTLISTS) \ $(NETLISTS) $(SCHS:=_2.net) schematics/twister.zip schematics/twister2.zip \ schematics/metropolis_transmitter.zip \ schematics/symbols.tgz $(SCH_PSS) $(PSGZS) $(SCH_PDFS) schematics/index.php \ schematics/metropolis_transmitter/metropolis_transmitter.pdf clean_sch_phps: rm -f $(SCHS:=.php) EPS2PSCONV=$(SCHS:=.ps) ZIPFILES_RAW=twister.pcb.output_back.gbr \ twister.pcb.output_backmask.gbr \ twister.pcb.output_fab.gbr \ twister.pcb.output_front.gbr \ twister.pcb.output_frontmask.gbr \ twister.pcb.output_frontsilk.gbr \ twister.pcb.output_plated-drill.cnc \ twister.pcb.output_back.ps \ twister.pcb.output_backmask.ps \ twister.pcb.output_fab.ps \ twister.pcb.output_front.ps \ twister.pcb.output_frontmask.ps \ twister.pcb.output_frontsilk.ps \ README.CZ \ README \ ZIPFILES=$(patsubst %,schematics/%,$(ZIPFILES_RAW)) ZIP2FILES_RAW=twister2.pcb.output_back.gbr \ twister2.pcb.output_backmask.gbr \ twister2.pcb.output_fab.gbr \ twister2.pcb.output_front.gbr \ twister2.pcb.output_frontmask.gbr \ twister2.pcb.output_frontsilk.gbr \ twister2.pcb.output_backsilk.gbr \ twister2.pcb.output_plated-drill.cnc \ twister2.pcb.output_back.ps \ twister2.pcb.output_backmask.ps \ twister2.pcb.output_fab.ps \ twister2.pcb.output_front.ps \ twister2.pcb.output_frontmask.ps \ twister2.pcb.output_frontsilk.ps \ twister2.pcb.output_backsilk.ps \ READMEcz.txt \ README.txt \ ZIP2FILES_MEDIUMRAW=$(patsubst %, twister2/%, $(ZIP2FILES_RAW)) ZIP2FILES=$(patsubst %, schematics/%, $(ZIP2FILES_MEDIUMRAW)) TXZIP_RAW=metropolis_transmitter.group0.gbr \ metropolis_transmitter.backmask.gbr \ metropolis_transmitter.fab.gbr \ metropolis_transmitter.group1.gbr \ metropolis_transmitter.frontmask.gbr \ metropolis_transmitter.frontsilk.gbr \ metropolis_transmitter.plated-drill.cnc \ metropolis_transmitter.ps \ README.CZ \ README TXZIP=$(patsubst %, metropolis_transmitter/%, $(TXZIP_RAW)) TEMPORARY+=schematics/twister schematics/twister.zip: $(ZIPFILES) rm -f schematics/twister.zip rm -rf schematics/twister mkdir schematics/twister cp $(ZIPFILES) schematics/twister cd schematics; zip twister.zip twister/ rm -rf schematics/twister schematics/twister2.zip: $(ZIP2FILES) rm -f schematics/twister2.zip cd schematics; zip twister2.zip $(ZIP2FILES_MEDIUMRAW) schematics/metropolis_transmitter.zip: $(patsubst %,schematics/%,$(TXZIP)) rm -f schematics/metropolis_transmitter.zip cd schematics; zip metropolis_transmitter.zip $(TXZIP) schematics/twister.pcb: schematics/twister.sch gsch2pcb schematics/twister.sch echo "twister.pcb and twister.net are up to date" schematics/twister.net: schematics/twister.sch gsch2pcb schematics/twister.sch echo "twister.pcb and twister.net are up to date" $(SCHS:=_1.net): %_1.net: %.sch attribs gnetlist -g bom -o $@ $(@:_1.net=.sch) $(SCHS:=_2.net): %_2.net: %.sch attribs gnetlist -g bom2 -o $@ $(@:_2.net=.sch) $(SCHS:=_1.html): %_1.html: %_1.net utils/bom %.pcb.output_xy.txt utils/bom 1 $(@:_1.html=.pcb.output_xy.txt) $< > $@ $(SCHS:=_1_cz.html) $(SCHS:=_2_cz.html) $(MULDULES:=_3_cz.html): \ %_cz.html: %.html schematics/czechize.script cat $(@:_cz.html=.html) | sed -f schematics/czechize.script > $@ $(MULDULES:=_cz.csv): %_cz.csv: %.csv schematics/czechize.script cat $(@:_cz.csv=.csv) | sed -f schematics/czechize.script >$@ $(SCHS:=_2.html): %_2.html: %_2.net utils/bom %.pcb.output_xy.txt utils/bom 2 $(@:_2.html=).pcb.output_xy.txt $< > $@ # So the make doesn't cry about nonexistent dependence. Most modules don't # have PCB and therefore also don't have xy file. %.pcb.output_xy.txt: touch $@ $(MULDULES:=_3.html): %_3.html: %_2.net utils/bom schematics/prices.csv if [ "$@" = "schematics/rexlator_3.html" ] ; then MUL=2; else MUL=1; \ fi; utils/bom 3 $< schematics/prices.csv $$MUL > $@ $(MULDULES:=.csv): %.csv: %_2.net utils/bom schematics/prices.csv if [ "$@" = "schematics/rexlator.csv" ] ; then MUL=2; else MUL=1; \ fi; utils/bom 4 $< schematics/prices.csv $$MUL > $@ $(SCHS:=.php): schematics/phpgen ./schematics/phpgen $(@:.php=) >$@ $(SCHS:=_small.png): %_small.png : %.png convert $(SCHEMATICS_SMALLCOMMANDS) $(@:_small.png=.png) $@ $(PSGZS): %.ps.gz: %.ps gzip -c $(@:.ps.gz=.ps) > $@ $(SCHS:=.png): %.png: %_01.ps utils/pssch2png utils/ppmreduce utils/pssch2png $(@:.png=_01.ps) $@ $(SCHS:=_00.ps): %_00.ps: %.sch utils/gsch2ps utils/gsch2ps $(@:_00.ps=.sch) $@ $(SCHS:=_01.ps): %_01.ps: %.sch utils/gsch2ps utils/gsch2ps $(@:_01.ps=.sch) $@ $(SCHS:=_10.ps): %_10.ps: %.sch utils/gsch2ps utils/gsch2ps $(@:_10.ps=.sch) $@ $(SCHS:=_11.ps): %_11.ps: %.sch utils/gsch2ps utils/gsch2ps $(@:_11.ps=.sch) $@ $(LSCHS:=0.eps): %eps: %ps utils/bbox utils/bbox.c perl utils/a2ping.pl $< EPS:$@ $(LSCHS:=2.ps): %2.ps: %0.eps utils/eps2ps if ( echo "$@" | grep /aui_) then \ cat $(@:2.ps=0.eps) | utils/eps2ps -s 0.557 - - | utils/ps_replace_land > $@ ; \ elif ( echo "$@" | grep /twister_ ) then \ cat $(@:2.ps=0.eps) | utils/eps2ps -s 0.54 - - | utils/ps_replace_land > $@ ; \ elif ( echo "$@" | grep /twister2 ) then \ cat $(@:2.ps=0.eps) | utils/eps2ps -s 0.326 - - | utils/ps_replace_land > $@ ; \ elif ( echo "$@" | grep '/\(audiofire_\|starquake_\)' ) then \ cat $(@:2.ps=0.eps) | utils/eps2ps -s 0.23 - - | utils/ps_replace_land > $@ ; \ else \ cat $(@:2.ps=0.eps) | utils/eps2ps -s 0.33 - - | utils/ps_replace_land > $@ ; \ fi schematics/metropolis_2.net: schematics/aui_forte.sch \ schematics/metropolis_transmitter/metropolis_transmitter.sch \ schematics/10M_receiver.sch schematics/heating.sch attribs gnetlist -g bom2 -o $@ $^ schematics/tetrapolis_2.net: schematics/twister2/twister2.sch \ schematics/metropolis_transmitter/metropolis_transmitter.sch \ schematics/10M_receiver.sch schematics/heating.sch attribs gnetlist -g bom2 -o $@ $^ schematics/rxtx_2.net: \ schematics/metropolis_transmitter/metropolis_transmitter.sch \ schematics/10M_receiver.sch attribs gnetlist -g bom2 -o $@ $^ schematics/rexlator_2.net: \ schematics/metropolis_transmitter/metropolis_transmitter.sch \ schematics/inferno_receiver.sch attribs gnetlist -g bom2 -o $@ $^ schematics/inferno_2.net: schematics/twister2/twister2.sch \ schematics/nebulus.sch schematics/inferno_receiver.sch schematics/heating.sch attribs gnetlist -g bom2 -o $@ $^ schematics/benchpress_2.net: schematics/audiofire.sch schematics/starquake.sch \ attribs gnetlist -g bom2 -o $@ $^ schematics/symbols.tgz: schematics/symbols/*.sym tar czvf schematics/symbols.tgz schematics/symbols schematics/index.php: $(SCHS:=.php) echo -ne '\n' >$@ for a in $(SCHEMATIC_MODULES); do echo -ne "

$$a

\n\n' >>$@; done echo "" >> $@