makefile.mingw.in 2.79 KB
Newer Older
1 2 3 4 5 6 7
## Makefile for building the gobject DLL with gcc for mingw. The build
## uses tools running on cygwin, however.

## Use: make -f makefile.mingw

TOP = ../..

8
include ../build/win32/make.mingw
9 10 11 12 13

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

# Nothing much configurable below

14
INCLUDES = -I .. -I ../glib -I .
15
DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=\"GLib-GObject\" -DG_ENABLE_DEBUG
16

17 18
srcdir=.

19
all : \
20
	libgobject-2.0.a \
21
	testgobject.exe \
Tor Lillqvist's avatar
Tor Lillqvist committed
22
	glib-genmarshal.exe
23

24 25 26 27 28 29 30 31
gobject_OBJECTS =		\
	gboxed.o		\
	gclosure.o		\
	genums.o		\
	gobject.o		\
	gparam.o		\
	gparamspecs.o		\
	gsignal.o		\
Tor Lillqvist's avatar
Tor Lillqvist committed
32
	gsourceclosure.o	\
33
	gtype.o			\
34
	gtypemodule.o		\
Tor Lillqvist's avatar
Tor Lillqvist committed
35
	gtypeplugin.o		\
36
	gvalue.o		\
37 38
	gvaluearray.o		\
	gvaluetransform.o	\
39
	gvaluetypes.o
40

41 42
libgobject-2.0.a : $(srcdir)/stamp-gmarshal.h gmarshal.c $(gobject_OBJECTS) gobject.def gobject-2.0.rc
	$(BUILD_DLL) gobject-2.0 @LT_CURRENT@:@LT_REVISION@:@LT_AGE@ gobject.def $(gobject_OBJECTS) -L ../glib -lglib-2.0
Tor Lillqvist's avatar
Tor Lillqvist committed
43 44

glib-genmarshal.exe : glib-genmarshal.c
45
	$(CC) -o $@ $(CFLAGS) -UGOBJECT_COMPILATION $< -L ../glib -lglib-2.0
46

47 48 49 50 51
testgobject.exe: libgobject-2.0.a testgobject.o
	$(CC) $(CFLAGS) -o testgobject.exe testgobject.o -L ../glib -lglib-2.0 -L . -lgobject-2.0 $(LFLAGS)

gobject-2.0.rc : gobject.rc
	cp $< $@
52 53 54 55 56 57 58 59 60 61 62 63 64 65

# Copied from Makefile.am:
# initial creation of the real stamp-* files
gmarshal.h:	# never add deps here
	test -f "$(srcdir)/$@" || touch $(srcdir)/$@
# normal autogeneration rules
# all autogenerated files need to be generated in the srcdir,
# so old versions get remade and are not confused with newer
# versions in the build dir. thus a development setup requires
# srcdir to be writable, passing --disable-rebuilds to
# ../configure will supress all autogeneration rules.
$(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal.exe
	echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
	&& echo "#define __G_MARSHAL_H__" >> xgen-gmh \
Tor Lillqvist's avatar
Tor Lillqvist committed
66
	&& PATH=../glib:$$PATH ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
67 68 69 70 71
	&& echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
	&& (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
	&& rm -f xgen-gmh xgen-gmh~ \
	&& echo timestamp > $@
$(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
Tor Lillqvist's avatar
Tor Lillqvist committed
72
	PATH=../glib:$$PATH ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
73 74 75 76 77 78 79 80
	&& cp xgen-gmc $(srcdir)/gmarshal.c \
	&& rm -f xgen-gmc xgen-gmc~
$(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
	grep '^[A-Z]' $(srcdir)/gmarshal.list \
	| sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
	&& cp xgen-gms $(srcdir)/gmarshal.strings \
	&& rm -f xgen-gms xgen-gms~
glib-genmarshal.o: gmarshal.strings
81 82 83

clean::
	-rm gmarshal.h gmarshal.c stamp-gmarshal.h