11.10Schristos# $NetBSD: Makefile,v 1.10 2005/12/11 12:17:34 christos Exp $
21.1Scgd#
31.1Scgd# Makefile to generate windows VC++ project and workspace files from
41.1Scgd# config files and templates
51.1Scgd
61.8Slukem.include <bsd.sys.mk>		# for HOST_SH
71.8Slukem
81.4StakemuraPROJECT_DIRS=libsa pbsdboot libz
91.1Scgd
101.7Sshinall: winfiles optfiles rom-boot
111.6Stakemura
121.1Scgdwinfiles: 
131.5Stakemura	for name in $(PROJECT_DIRS); do \
141.8Slukem	    ${HOST_SH} dspgen/config.sh vc6 $$name; \
151.8Slukem	    ${HOST_SH} dspgen/config.sh evc3 $$name; \
161.1Scgd	done
171.8Slukem	${HOST_SH} dspgen/gen_workspace.sh vc6 hpcmips_stand.dsw $(PROJECT_DIRS)
181.8Slukem	${HOST_SH} dspgen/gen_workspace.sh evc3 hpcmips_stand.vcw $(PROJECT_DIRS)
191.2Scgd
201.6Stakemuraoptfiles:
211.6Stakemura	echo "/* option \`SPEC_PLATFORM' not defined */" \
221.6Stakemura            > pbsdboot/opt_spec_platform.h
231.6Stakemura
241.2Scgd# remote transient build-related files globally and for each project:
251.2Scgd#	* global 'class view' information (.ncb)
261.2Scgd#	* Debug and Release compile dirs,
271.2Scgd#	* .plg files (build logs), and
281.2Scgd#	* .[0-9][0-9][0-9] files (old versions of auto-converted .dsp files).
291.2Scgd
301.7Sshinrom-boot:
311.7Sshin	(cd romboot; make)
321.7Sshin
331.2Scgdclean:
341.2Scgd	rm -f hpcmips_stand.ncb
351.9Sjmc	-for dir in $(PROJECT_DIRS); do \
361.3Stakemura	    (cd $$dir && rm -rf WMIPSDbg wmipsdbg WMIPSRel wmipsrel); \
371.5Stakemura	    (cd $$dir && rm -f $$dir.plg $$dir.vcl $$dir.[0-9][0-9][0-9]); \
381.5Stakemura	    (cd $$dir && rm -f $$dir.ncb $$dir.opt); \
391.2Scgd	done
401.6Stakemura	rm -f pbsdboot/opt_spec_platform.h
411.7Sshin	(cd romboot; make clean)
421.2Scgd
431.2Scgd# remove all files which windows is likely to have created, in addition
441.2Scgd# to transient build-related files:
451.2Scgd#	* .opt workspace option file
461.2Scgd#	* (probably automatic) updates to the .dsp and .dsw files,
471.2Scgd#	  which should be identical to the auto-generated versions when
481.2Scgd#	  clean.
491.2Scgd
501.2Scgddistclean cleandir: clean winfiles
511.2Scgd	rm -f hpcmips_stand.opt
521.5Stakemura	rm -f hpcmips_stand.vcw
531.5Stakemura	rm -f hpcmips_stand.vco
541.5Stakemura	rm -f hpcmips_stand.vcb
551.5Stakemura	for dir in $(PROJECT_DIRS); do \
561.5Stakemura	    (cd $$dir && rm -f $$dir.vcp); \
571.5Stakemura	done
58