1 ## Makefile for building the GLib, gmodule and gthread DLLs with
3 ## Use: make -f makefile.cygwin install
5 # Change this to wherever you want to install the DLLs. This directory
6 # should be in your PATH.
9 # This is the location of pthreads for Win32,
10 # see http://sourceware.cygnus.com/pthreads-win32/
11 # We want the 1999-05-30 snapshot.
12 PTHREADS = ../pthreads-snap-1999-05-30
13 PTHREAD_LIB = -L$(PTHREADS) -lpthread32
14 PTHREAD_INC = -I $(PTHREADS)
18 ################################################################
20 # Nothing much configurable below
22 CC = gcc -mno-cygwin -mpentium -fnative-struct
29 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
31 CFLAGS = $(OPTIMIZE) -I. -DHAVE_CONFIG_H
36 glib-$(GLIB_VER).dll \
37 gmodule/gmoduleconf.h \
38 gmodule-$(GLIB_VER).dll \
39 gthread-$(GLIB_VER).dll \
46 $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
47 $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
48 $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
80 glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
81 ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) -luser32 -lwsock32
83 glibconfig.h: glibconfig.h.win32
84 $(CP) glibconfig.h.win32 glibconfig.h
86 config.h: config.h.win32
87 $(CP) config.h.win32 config.h
92 $(CC) $(CFLAGS) -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $<
95 $(CC) $(CFLAGS) -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
100 gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule/gmodule.def
101 ./build-dll gmodule $(GLIB_VER) gmodule/gmodule.def $(gmodule_OBJECTS) -L. -lglib-$(GLIB_VER) -lwsock32
103 gmodule.o : gmodule/gmodule.c gmodule/gmodule-win32.c
104 $(CC) $(CFLAGS) -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule/gmodule.c
106 gmodule/gmoduleconf.h: gmodule/gmoduleconf.h.win32
107 $(CP) gmodule/gmoduleconf.h.win32 gmodule/gmoduleconf.h
112 gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) glib-$(GLIB_VER).dll gthread/gthread.def
113 ./build-dll gthread $(GLIB_VER) gthread/gthread.def $(gthread_OBJECTS) -L. -lglib-$(GLIB_VER) $(PTHREAD_LIB)
115 gthread-impl.o : gthread/gthread-impl.c gthread/gthread-posix.c
116 $(CC) $(CFLAGS) $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread/gthread-impl.c
118 testglib.exe : glib-$(GLIB_VER).dll testglib.o
119 $(CC) $(CFLAGS) -o testglib testglib.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
121 testglib.o : testglib.c
122 $(CC) -c $(CFLAGS) testglib.c
124 testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
125 $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
127 testgdate.o : testgdate.c
128 $(CC) -c $(CFLAGS) testgdate.c
130 testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
131 $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
133 testgdateparser.o : testgdateparser.c
134 $(CC) -c $(CFLAGS) testgdateparser.c
136 testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.o libgplugin_a.dll libgplugin_b.dll
137 # Wow, do we really have to do it like this to get some symbols
138 # exported from a .exe? Apparently yes. Does the __declspec(dllexport)
139 # actually do anything in egcs-1.1.2?
140 $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
141 $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
142 $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base,testgmodule.exp -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
143 $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
144 $(CC) $(CFLAGS) -Wl,testgmodule.exp -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
146 testgmodule.o : gmodule/testgmodule.c
147 $(CC) $(CFLAGS) -Igmodule -c gmodule/testgmodule.c
149 libgplugin_a.dll : libgplugin_a.o
150 ./build-dll libgplugin_a - - libgplugin_a.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER)
152 libgplugin_a.o : gmodule/libgplugin_a.c
153 $(CC) $(CFLAGS) -Igmodule -c gmodule/libgplugin_a.c
155 libgplugin_b.dll : libgplugin_b.o
156 ./build-dll libgplugin_b - - libgplugin_b.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER)
158 libgplugin_b.o : gmodule/libgplugin_b.c
159 $(CC) $(CFLAGS) -Igmodule -c gmodule/libgplugin_b.c
162 -rm config.h glibconfig.h gmodule/gmoduleconf.h
163 -rm *.exe *.o *.dll *.a *.base *.exp