#==============================================================================
# $Id: Makefile,v 1.2 1999/09/11 14:38:48 hofer Exp hofer $
#==============================================================================

NAME = nosecurity
DBNAME = "No Security"
CREATOR = NoSe

HEADERS = resources.h
OBJECTS = nosecurity.o
BITMAPS = icon.bmp smallicon.bmp

SHELL = /bin/sh
BIN = /usr/palm/bin
CC = $(BIN)/m68k-palmos-coff-gcc
CFLAGS = -Wall -Wno-switch -ggdb -O2
OBJRES = $(BIN)/m68k-palmos-coff-obj-res
BUILDPRC = $(BIN)/build-prc
PILRC = $(BIN)/pilrc

#------------------------------------------------------------------------------

all: $(NAME).prc

nosecurity.o: nosecurity.c

# build the prc
$(NAME).prc: bin.stamp grc.stamp
	$(BUILDPRC) $(NAME).prc $(DBNAME) $(CREATOR) *.grc *.bin 
	ls -l *.prc

# link objects and generate code resources (.grc)
grc.stamp: $(OBJECTS)
	$(CC) $(CFLAGS) -o $(NAME) $(OBJECTS)
	-rm *.grc
	$(OBJRES) $(NAME)
	touch grc.stamp

# generate resources (.bin)
bin.stamp: resources.rcp $(BITMAPS) README.TXT
	-rm *.bin
	$(PILRC) resources.rcp
	touch bin.stamp

# compile a module
.c.o: $(HEADERS)
	$(CC) $(CFLAGS) -c -o $*.o $*.c

# nuke the non-source files (and emacs backups)
clean:
	-rm *.bin *.grc *~ *.o *.stamp $(NAME)

# make the distribution zip file
zip: $(NAME).prc
	-rm *.zip
	zip $(NAME) *.TXT *.prc *.c *.h *.rcp *.bmp Makefile

#==============================================================================
