CC = wgcc -g VFLAG = -V OPTFLAG = -O99 CFLAGS = $(OPTFLAG) $(VFLAG) -DSCORELIST=\"/var/games/asteroids-highscore\" -DANSI_PASTE ARCH != uname -m .if exists(gl-asm-$(ARCH).s) && !defined(FORCE_GENERIC) ASM_O = gl-asm-$(ARCH).o .else ASM_O = gl-generic.o .endif SOUNDS != cat soundlist SOUND_O = $(SOUNDS:C/.*/sound-data-&.o/) O = $(ASM_O) $(SOUND_O) afont.o ahelp.o gl-idev-none.o gl-idev-sun3.o\ gl-idev-sun4.o gl-odev-bwtwo.o gl-odev-cgsix.o gl-odev-cgthree.o gl.o\ sound-data.o sounds.o CLEANFILES = $O *= *.core PREDEPFILES = .MAIN: /asteroids/a /asteroids/a: a rm -f /asteroids/a && cp a /asteroids/a .PHONY: all all: a linetest dumpbwtwo sound-ids.h: soundlist gen-sound-ids gen-sound-ids < soundlist > $(.TARGET) || ( rm -f $(.TARGET) ; false ) CLEANFILES += sound-ids.h PREDEPFILES += sound-ids.h .for s in $(SOUNDS) sound-data-$s.c: 16-to-c sound-data-$s.16 16-to-c snd_$s < sound-data-$s.16 > sound-data-$s.c || ( rm -f sound-data-$s.c ; false ) CLEANFILES += sound-data-$s.c PREDEPFILES += sound-data-$s.c .endfor sound-data.c: soundlist gen-sound-data gen-sound-data < soundlist > sound-data.c || ( rm -f $(.TARGET) ; false ) CLEANFILES += sound-data.c PREDEPFILES += sound-data.c 16-to-c: 16-to-c.c $(CC) -o 16-to-c 16-to-c.c CLEANFILES += 16-to-c a: a.o $O $(CC) -static -o a a.o $O -lm -lcrypt CLEANFILES += a a.o linetest: linetest.o $O $(CC) -o linetest linetest.o $O -lm -lcrypt CLEANFILES += linetest linetest.o dumpbwtwo: dumpbwtwo.o $(CC) -o dumpbwtwo dumpbwtwo.o CLEANFILES += dumpbwtwo dumpbwtwo.o ahelp.c: ahelp.txt ahelp.awk awk -f ahelp.awk < ahelp.txt > ahelp.c CLEANFILES += ahelp.c .s.o: as -o $(.TARGET) $(.IMPSRC) .PHONY: depend depend: $(PREDEPFILES) mkdep $(CFLAGS) *.c CLEANFILES += .depend .PHONY: clean clean: rm -f $(CLEANFILES)