# Makefile for W-Jewel
#
# Window.c file (and the bitmaps to some extent) is GUI dependent.
# Other files use the functions provided by window.c and should
# be portable.

include ../../.config

CPPFLAGS = -I../../lib
CFLAGS = $(ADDCFLAGS)
LDFLAGS = $(ADDLDFLAGS) -L../../lib 
LDLIBS = -lW
#LDLIBS = -lWg -lefence
#LDLIBS = -lW2X -L/usr/X11R6/lib -lX11
LIBDEP = ../../lib/$(WLIB)

ifeq ($(ARCH),MiNT)
CFLAGS += -mbaserel
LDFLAGS += -mbaserel
# need portlib as MiNTlib (PL46) gettimeofday() has 2sec resolution...
LDLIBS += -lsocket -lport
endif

OBJS	= 16x16.o 32x32.o jewel.o game.o window.o
NAME	= wjewel

all: $(NAME)

$(NAME): $(OBJS) $(LIBDEP)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

$(NAME).sym: $(OBJS) $(LIBDEP)
	toglclr -fshare $(NAME)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) -B /usr/gnu/sym-


$(OBJS): jewel.h


clean:
	$(RM) *~ *.o

veryclean: clean
	$(RM) $(NAME) $(NAME).sym

package: veryclean
	tar -zcvf ../$(NAME).tgz -C ../ $(NAME)/
