1 ###########################################################################
2 # $Id$
3 ###########################################################################
4 # Makefile for building with MinGW
5 ###########################################################################
7 include ../Makefile.mingw.common
9 all: generated outputs
11 ###################################
12 # G E N E R A T E D F I L E S
13 ###################################
15 generated: helper/sp-marshal.h helper/sp-marshal.cpp inkscape_version.h
19 helper/sp-marshal.h: helper/sp-marshal.h.mingw
20 $(CP) $(subst /,$(S), $<) $(subst /,$(S), $@)
22 helper/sp-marshal.cpp: helper/sp-marshal.cpp.mingw
23 $(CP) $(subst /,$(S), $<) $(subst /,$(S), $@)
25 inkscape_version.h: inkscape_version.h.mingw
26 $(CP) inkscape_version.h.mingw inkscape_version.h
29 ###################################
30 # D E P E N D E N C I E S
31 ###################################
33 include ./make.dep
35 INC += $(DEPTOOL_INCLUDE)
37 OBJ = $(DEPTOOL_OBJECTS)
41 ###################################
42 # O U T P U T S
43 ###################################
45 outputs: inkscape.exe inkview.exe
48 RES=inkres.o
50 inkscape.exe: libinkscape.a main.o winmain.o $(RES)
51 $(CXX) --export-dynamic -o inkscape.exe main.o winmain.o $(RES) libinkscape.a $(LIBS)
52 $(OBJCOPY) --only-keep-debug inkscape.exe inkscape.dbg
53 strip inkscape.exe
55 # DLL version. we need to make this work
56 #inkscape.exe: inkscape.dll main.o winmain.o $(RES)
57 # $(CXX) -o inkscape.exe main.o winmain.o $(RES) inkscape.la $(LIBS)
58 # strip inkscape.exe
60 inkview.exe: libinkscape.a inkview.o $(RES)
61 $(CXX) -o inkview.exe inkview.o $(RES) libinkscape.a $(LIBS)
62 $(OBJCOPY) --only-keep-debug inkview.exe inkview.dbg
63 strip inkview.exe
65 # DLL version. we need to make this work
66 # inkview.exe: inkscape.dll inkview.o $(RES)
67 # $(CXX) -o inkview.exe inkview.o $(RES) libinkscapedll.a $(LIBS)
68 # strip inkview.exe
70 inkres.o: inkscape.rc
71 $(WINDRES) inkscape.rc $(RES)
73 inkscape.dll: libinkscape.a inkscape.def
74 $(DLLWRAP) --output-lib=inkscape.la \
75 --def=inkscape.def --driver-name=g++ \
76 -o inkscape.dll libinkscape.a $(LIBS)
78 inkscape.def: libinkscape.a
79 perl makedef.pl
81 libinkscape.a: $(OBJ)
82 -$(RM) libinkscape.a
83 ar crv libinkscape.a $(OBJ)
84 $(RANLIB) libinkscape.a
86 inkscape.la: inkscape.dll
90 ###################################
91 # P L U G I N S
92 ###################################
94 .o.dll: $<
95 $(DLLWRAP) --def=plugin.def --driver-name=g++ \
96 -o $@ $< $(LIBS)
98 PLUGS = extension/plugin/gimpgrad.dll
100 plugins: $(PLUGS)
102 extension/plugin/gimpgrad.dll: extension/plugin/gimpgrad.o inkscape.la
103 $(DLLWRAP) --def=plugin.def --driver-name=g++ \
104 -dllname $@ $< inkscape.la $(LIBS) -lgc
105 strip $@
110 ###################################
111 # C L E A N U P
112 ###################################
114 clean:
115 $(foreach a, $(OBJ), $(shell $(RM) $(subst /,$(S), $(a))))
116 -$(RM) main.o winmain.o inkview.o
117 -$(RM) *.a
118 -$(RM) *.la
119 -$(RM) inkscape.def
120 -$(RM) *.dll
121 -$(RM) extension$(S)plugin$(S)*.o
122 -$(RM) extension$(S)plugin$(S)*.dll
123 -$(RM) inkscape.exe inkview.exe inkscape.dbg inkview.dbg