#
# File:		makefile.g95
# Author:	Julian Smart
# Created:	1996
#
# "%W% %G%"
#
# Makefile : Builds wxProp library and example under GNU-WIN32
#
WXDIR = ../../..
include $(WXDIR)/src/makeg95.env

PROPDIR = $(WXDIR)/utils/wxprop
PROPLIB = $(PROPDIR)/lib/$(LIBPREFIX)wxprop.$(LIBSUFF)
THISDIR = $(PROPDIR)/src

OBJECTS = $(OBJDIR)/prop.$(OBJSUFF) $(OBJDIR)/proplist.$(OBJSUFF) $(OBJDIR)/propform.$(OBJSUFF)
TESTOBJECTS = $(OBJDIR)/test.$(OBJSUFF) $(OBJDIR)/test_resources.$(OBJSUFF)

LDFLAGS =  -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib -L../lib
LDLIBS=-lwxprop $(LIBS)

all:    $(OBJDIR) $(PROPLIB)

test:   $(OBJDIR) test.exe

$(OBJDIR):
	mkdir $(OBJDIR)

$(PROPLIB):      $(OBJECTS)
	rm -f $@
	ar $(AROPTIONS) $@ $(OBJECTS)
	$(RANLIB) $@

$(OBJDIR)/test.$(OBJSUFF):		test.h test.$(SRCSUFF) $(PROPLIB)
	$(CC) -c $(CPPFLAGS) -o $@ test.$(SRCSUFF)

test.exe: $(TESTOBJECTS)
	$(CC) $(LDFLAGS) -o test$(GUISUFFIX)$(EXESUFF) $(TESTOBJECTS) $(LDLIBS)

$(OBJDIR)/prop.$(OBJSUFF):      prop.h prop.$(SRCSUFF)
	$(CC) -c $(CPPFLAGS) -o $@ prop.$(SRCSUFF)

$(OBJDIR)/proplist.$(OBJSUFF):      proplist.h prop.h proplist.$(SRCSUFF)
	$(CC) -c $(CPPFLAGS) -o $@ proplist.$(SRCSUFF)

$(OBJDIR)/propform.$(OBJSUFF):      propform.h prop.h propform.$(SRCSUFF)
	$(CC) -c $(CPPFLAGS) -o $@ propform.$(SRCSUFF)

$(OBJDIR)/test_resources.o:  test.rc
	$(RESCOMP) -i test.rc -o $(OBJDIR)/test_resources.o $(RESFLAGS)

clean:
	rm -f *.$(OBJSUFF) $(PROPLIB) objects/test.o *.exe *.res *.map *.rsc
