SHELL=/bin/sh
#
# Makefile for Pacifi3d
#

VERSION=0.1

all:
	@echo "Please specify target:"
	@echo "(For example, type \"make linux\" for a Linux system.)"
	@(cd makefiles && ls -C Makefile* | sed -e 's/Makefile.//g')

.DEFAULT:
	@($(MAKE) -f makefiles/Makefile.$@ VERSION=$(VERSION))

clean:
	rm -f $(PACKAGES)
	@($(MAKE) -f src/Makefile.common clean)


# targets to build packages
PACKAGES=pacifi3d$(VERSION)-src.tgz \
         pacifi3d$(VERSION)-linux-i386.tgz \
         pacifi3d$(VERSION)-win32.zip

DOCS=pacifi3d.html screen1.jpg screen2.jpg roms/rom.txt
SRC=Makefile src makefiles sdl.dll README-SDL.txt
WINFILES=pacifi3d.exe sdl.dll README-SDL.txt
LINFILES=pacifi3d

packages:	$(PACKAGES)

%.zip:
	zip $@ $^

%.tgz:
	tar czvf $@ $^

pacifi3d$(VERSION)-win32.zip:	$(DOCS) $(WINFILES)
pacifi3d$(VERSION)-linux-i386.tgz:	$(DOCS) $(LINFILES)
pacifi3d$(VERSION)-src.tgz:	$(DOCS) $(SRC) $(WEB)
