summaryrefslogtreecommitdiffstats
path: root/src/Makefile.mingw
blob: b3afb5cfedb9c7ec535189bf87ae0dce58b63bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
###########################################################################
#  $Id$
###########################################################################
# Makefile for building with MinGW
###########################################################################

include ../Makefile.mingw.common

all: generated outputs

###################################
# G E N E R A T E D    F I L E S
###################################

generated: helper/sp-marshal.h helper/sp-marshal.cpp inkscape_version.h



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


###################################
# D E P E N D E N C I E S
###################################

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

INC += $(INCLUDEPATH)

OBJ = $(OBJECTS)



###################################
# O U T P U T S
###################################

outputs: inkscape.exe inkview.exe


RES=inkres.o

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

# DLL version.  we need to make this work
#inkscape.exe: inkscape.dll main.o winmain.o $(RES) 
#	$(CXX) -o inkscape.exe main.o winmain.o $(RES) inkscape.la $(LIBS)
#	strip inkscape.exe

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

# DLL version.  we need to make this work
# inkview.exe: inkscape.dll inkview.o $(RES) 
#	$(CXX) -o inkview.exe inkview.o $(RES) libinkscapedll.a $(LIBS)
#	strip inkview.exe

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

inkscape.dll: libinkscape.a inkscape.def
	$(DLLWRAP) --output-lib=inkscape.la \
	--def=inkscape.def --driver-name=g++ \
	-o inkscape.dll libinkscape.a $(LIBS)

inkscape.def: libinkscape.a
	perl makedef.pl
	
libinkscape.a: $(OBJ)
	-$(RM) libinkscape.a
	ar crv libinkscape.a $(OBJ)
	$(RANLIB) libinkscape.a

inkscape.la: inkscape.dll



###################################
# P L U G I N S
###################################

.o.dll: $<
	$(DLLWRAP) --def=plugin.def --driver-name=g++ \
	-o $@ $< $(LIBS)

PLUGS = extension/plugin/gimpgrad.dll

plugins: $(PLUGS)

extension/plugin/gimpgrad.dll: extension/plugin/gimpgrad.o inkscape.la
	$(DLLWRAP) --def=plugin.def --driver-name=g++ \
	-dllname $@ $< inkscape.la $(LIBS) -lgc
	strip $@




###################################
# C L E A N U P
###################################

clean:
	$(foreach a, $(OBJ), $(shell $(RM) $(subst /,$(S), $(a))))
	-$(RM) main.o winmain.o inkview.o
	-$(RM) *.a
	-$(RM) *.la
	-$(RM) inkscape.def
	-$(RM) *.dll
	-$(RM) extension$(S)plugin$(S)*.o
	-$(RM) extension$(S)plugin$(S)*.dll