makefile.msc 1.97 KB
Newer Older
Tor Lillqvist's avatar
Tor Lillqvist committed
1 2 3 4 5 6 7 8 9 10 11
## Makefile for building gimp modules with Microsoft C
## Use: nmake -f makefile.msc

# Change this to wherever you install the gimp.
GIMP = D:\gimp
BIN = $(GIMP)\modules

################################################################

# Nothing much configurable below

12 13 14 15 16 17 18 19 20 21
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD
LINKDEBUG = /subsystem:windows
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
LINKDEBUG = /subsystem:console /debug
!ENDIF

22
# cl -? describes the options
23
CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
Tor Lillqvist's avatar
Tor Lillqvist committed
24

25
LDFLAGS = /link $(LINKDEBUG)
Tor Lillqvist's avatar
Tor Lillqvist committed
26 27 28 29
INSTALL = copy

GIMP_VER = 1.1
GTK_VER = 1.3
Tor Lillqvist's avatar
Tor Lillqvist committed
30
GLIB_VER = 1.3
Tor Lillqvist's avatar
Tor Lillqvist committed
31

Tor Lillqvist's avatar
Tor Lillqvist committed
32
GLIB = ..\..\glib
Tor Lillqvist's avatar
Tor Lillqvist committed
33
GMODULE = $(GLIB)\gmodule
Tor Lillqvist's avatar
Tor Lillqvist committed
34
GTK = ..\..\gtk+
Tor Lillqvist's avatar
Tor Lillqvist committed
35

Tor Lillqvist's avatar
Tor Lillqvist committed
36
CFLAGS = -DHAVE_CONFIG_H -DMODULE_COMPILATION -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)\gdk\win32 -I$(GTK)
Tor Lillqvist's avatar
Tor Lillqvist committed
37

38
MODULES = \
Tor Lillqvist's avatar
Tor Lillqvist committed
39 40 41
	colorsel_gtk-$(GIMP_VER).dll \
	colorsel_triangle-$(GIMP_VER).dll \
	colorsel_water-$(GIMP_VER).dll
Tor Lillqvist's avatar
Tor Lillqvist committed
42 43 44 45 46 47


all : \
	$(MODULES)

install : all
48
	for %m in ($(MODULES)) do copy %m $(BIN)
Tor Lillqvist's avatar
Tor Lillqvist committed
49 50 51 52

..\config.h : ..\config.h.win32
	copy ..\config.h.win32 ..\config.h

Tor Lillqvist's avatar
Tor Lillqvist committed
53
colorsel_gtk-$(GIMP_VER).dll : colorsel_gtk.obj module.def
54 55
	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_gtk.obj $(LDFLAGS) ..\app\gimp.lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib $(GLIB)\glib-$(GLIB_VER).lib /def:module.def

Tor Lillqvist's avatar
Tor Lillqvist committed
56
colorsel_triangle-$(GIMP_VER).dll : colorsel_triangle.obj module.def
57
	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_triangle.obj $(LDFLAGS) ..\app\gimp.lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib $(GLIB)\glib-$(GLIB_VER).lib /def:module.def
Tor Lillqvist's avatar
Tor Lillqvist committed
58

Tor Lillqvist's avatar
Tor Lillqvist committed
59
colorsel_water-$(GIMP_VER).dll : colorsel_water.obj module.def
60
	$(CC) $(CFLAGS) -LD -Fe$@ colorsel_water.obj $(LDFLAGS) ..\app\gimp.lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib $(GLIB)\glib-$(GLIB_VER).lib /def:module.def
Tor Lillqvist's avatar
Tor Lillqvist committed
61 62 63

# General rule for building 
.c.obj:
64
	$(CC) $(CFLAGS) -GD -c $<
Tor Lillqvist's avatar
Tor Lillqvist committed
65 66

clean:
67
	del *.dll
Tor Lillqvist's avatar
Tor Lillqvist committed
68 69 70 71 72 73 74 75
	del *.lib
	del *.obj
	del *.exp
	del *.err
	del *.map
	del *.sym
	del *.pdb
	del *.ilk