test: laugh.exe
	./laugh laugh.wav
laugh.exe: laugh.o laugh.res
	gcc -mno-cygwin -mwindows -o $@ laugh.o laugh.res \
		/usr/lib/w32api/libwinmm.a \
		/usr/lib/w32api/libkernel32.a
	cmd.exe /c install
laugh.o: laugh.c
	gcc -mno-cygwin -mwindows -c -o $@ laugh.c
laugh.res: laugh.rc
	windres $< -O coff -o $@
clean:
	rm -f *.o *.res
distclean: clean
	cmd.exe /c uninstall
	rm -f laugh.exe laugh.zip
dist: laugh.exe
	cd .. && zip laugh/laugh.zip laugh/laugh.exe laugh/laugh.wav \
	 laugh/install.bat laugh/uninstall.bat
