###########################################################################
#  $Id$
###########################################################################
# Makefile for building with MinGW
###########################################################################

include ../Makefile.mingw.common



#Check for 'generated' files
all: helper/sp-marshal.h helper/sp-marshal.cpp inkscape_version.h inkscape.exe

helper/sp-marshal.h: helper/sp-marshal.h.mingw
	$(CP) $(subst /,$(S), $<) $(subst /,$(S), $@)

helper/sp-marshal.cpp: helper/sp-marshal.cpp.mingw
	$(CP) $(subst /,$(S), $<) $(subst /,$(S), $@)

inkscape_version.h: inkscape_version.h.mingw
	$(CP) inkscape_version.h.mingw inkscape_version.h

include ./make.ofiles
include ./make.dep

INC += $(INCLUDEPATH)

OBJ = $(OBJECTS)

RES=inkres.o

inkscape.exe: libinkscape.a main.o winmain.o $(RES) 
	$(CXX) -o inkscape.exe main.o winmain.o $(RES) libinkscape.a $(LIBS)
#	strip inkscape.exe

inkview.exe: libinkscape.a inkview.o $(RES) 
	$(CXX) -o inkview.exe inkview.o $(RES) libinkscape.a $(LIBS)
	strip inkview.exe

inkres.o: inkscape.rc
	$(WINDRES) inkscape.rc $(RES)

libinkscape.a: $(OBJ)
	$(RM) libinkscape.a
	ar crv libinkscape.a $(OBJ)
	$(RANLIB) libinkscape.a


clean:
	$(foreach a, $(OBJ), $(shell $(RM) $(subst /,$(S), $(a))))
	$(RM) *.a


