e350ef4d9479f67aff791bcfe6b62d760df473e5
[platform/upstream/glib.git] / gobject / makefile.mingw.in
1 ## Makefile for building the gobject DLL with gcc for mingw. The build
2 ## uses tools running on cygwin, however.
3
4 ## Use: make -f makefile.mingw
5
6 TOP = ../..
7
8 include ../build/win32/make.mingw
9
10 ################################################################
11
12 # Nothing much configurable below
13
14 INCLUDES = -I .. -I ../glib -I .
15 DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=g_log_domain_gruntime -DG_ENABLE_DEBUG
16
17 srcdir=.
18
19 all : \
20         libgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a \
21         testgruntime.exe \
22         glib-genmarshal.exe
23
24 gobject_OBJECTS =               \
25         gboxed.o                \
26         gclosure.o              \
27         genums.o                \
28         gobject.o               \
29         gparam.o                \
30         gparamspecs.o           \
31         gsignal.o               \
32         gtype.o                 \
33         gtypemodule.o           \
34         gtypeplugin.o           \
35         gvalue.o                \
36         gvaluearray.o           \
37         gvaluetransform.o       \
38         gvaluetypes.o
39
40 libgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a : $(srcdir)/stamp-gmarshal.h gmarshal.c $(gobject_OBJECTS) gobject.def 
41         $(BUILD_DLL) gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ @LT_CURRENT@:@LT_REVISION@:@LT_AGE@ gobject.def $(gobject_OBJECTS) -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
42
43 glib-genmarshal.exe : glib-genmarshal.c
44         $(CC) -o $@ $(CFLAGS) -UGOBJECT_COMPILATION $< -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
45
46 testgruntime.exe: libgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.a testgruntime.o
47         $(CC) $(CFLAGS) -o testgruntime.exe testgruntime.o -L ../glib -lglib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ -L . -lgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ $(LFLAGS)
48
49 # Copied from Makefile.am:
50 # initial creation of the real stamp-* files
51 gmarshal.h:     # never add deps here
52         test -f "$(srcdir)/$@" || touch $(srcdir)/$@
53 # normal autogeneration rules
54 # all autogenerated files need to be generated in the srcdir,
55 # so old versions get remade and are not confused with newer
56 # versions in the build dir. thus a development setup requires
57 # srcdir to be writable, passing --disable-rebuilds to
58 # ../configure will supress all autogeneration rules.
59 $(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal.exe
60         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
61         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
62         && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
63         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
64         && (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
65         && rm -f xgen-gmh xgen-gmh~ \
66         && echo timestamp > $@
67 $(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
68         ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
69         && cp xgen-gmc $(srcdir)/gmarshal.c \
70         && rm -f xgen-gmc xgen-gmc~
71 $(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
72         grep '^[A-Z]' $(srcdir)/gmarshal.list \
73         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
74         && cp xgen-gms $(srcdir)/gmarshal.strings \
75         && rm -f xgen-gms xgen-gms~
76 glib-genmarshal.o: gmarshal.strings
77
78 clean::
79         -rm gmarshal.h gmarshal.c stamp-gmarshal.h