]> Pileus Git - ~andy/gtk/blobdiff - gdk/win32/makefile.cygwin
Large changes to the Win32 backend, partially made necessary by the
[~andy/gtk] / gdk / win32 / makefile.cygwin
index 8cfe60ca90e4fb1fd660f53e89ddd053d913016b..f6f0d1b62f5e7d941c7d8a3fa72bc378c48ce219 100644 (file)
@@ -1,15 +1,11 @@
-## Makefile for building the GDK DLL with egcs on cygwin
-## Use: make -f makefile.cygwin install
-
-# Change this to wherever you want to install the DLL. This directory
-# should be in your PATH.
-BIN = bin
+## Makefile for building the machine dependent part of GDK on Win32 with gcc 
+## Use: make -f makefile.cygwin 
 
 # Location of the Wintab toolkit. Downloadable from http://www.pointing.com.
 # We use the wntab32x.lib archive library directly (copy it as libwntab32x.a).
 WTKIT = ../../../wtkit126
 
-OPTIMIZE = -g -O
+OPTIMIZE = -g
 
 ################################################################
 
@@ -17,77 +13,89 @@ OPTIMIZE = -g -O
 
 CC = gcc -mno-cygwin -mpentium -fnative-struct
 
-CP = cp
-LD = ld
-INSTALL = install
-
 GLIB_VER=1.3
 GTK_VER=1.3
 
 GLIB = ../../../glib
-CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\" -DNEAR= -DFAR=
+CFLAGS = $(OPTIMIZE) -I . -I .. -I ../.. -I $(WTKIT)/include -I $(GLIB) -DG_ENABLE_DEBUG -DHAVE_CONFIG_H -DGDK_VERSION=\"$(GTK_VER)\"
 
 all: \
-       gdk/gdkprivate.h \
-       gdk/gdkx.h      \
-       ../../config.h  \
-       gdk-$(GTK_VER).dll
-
-install : all
-       $(INSTALL) gdk-$(GTK_VER).dll $(BIN)
-
-gdk_OBJECTS = \
-       gdk.o           \
-       gdkcc.o         \
-       gdkcolor.o      \
-       gdkcursor.o     \
-       gdkdnd.o        \
-       gdkdraw.o       \
-       gdkevents.o     \
-       gdkfont.o       \
-       gdkgc.o         \
-       gdkglobals.o    \
-       gdkim.o         \
-       gdkimage.o      \
-       gdkinput.o      \
-       gdkpixmap.o     \
-       gdkproperty.o   \
-       gdkrgb.o        \
-       gdkrectangle.o  \
-       gdkregion.o     \
-       gdkselection.o  \
-       gdkvisual.o     \
-       gdkwindow.o     \
-       gdkxid.o
-
-# We must have copies of gdkx.h and gdkprivate.h in the gdk
-# subdirectory, so that application sources which want to be
-# compilable with both GTk+ 1.2 (where there are no separate backend
-# gdk directories) and this 1.3 version (where the Win32 backend is in
-# the directory of *this* file you are reading right now) can use
-# #include <gdk/gdkprivate.h>.
-
-# Applications that depend on GTk+ 1.3 or later should include
-# gdkprivate.h and/or gdkx.h without the gdk/ prefix. The CFLAGS should
-# include an -I switch pointing to the backend-specific directory
-# (*this* directory in the Win32 case).
-
-gdk/gdkprivate.h : gdkprivate.h
-       -mkdir gdk
-       cp gdkprivate.h gdk
-
-gdk/gdkx.h : gdkx.h
-       -mkdir gdk
-       cp gdkx.h gdk
+       ../../config.h \
+       ../gdkconfig.h \
+       libgdk-win32.a \
+       gdk-win32res.o \
+       libwntab32x.a
+
+gdk_win32_OBJECTS = \
+       gdkcc-win32.o \
+       gdkcolor-win32.o \
+       gdkcursor-win32.o \
+       gdkdnd-win32.o \
+       gdkdrawable-win32.o \
+       gdkevents-win32.o \
+       gdkfont-win32.o \
+       gdkgc-win32.o \
+       gdkgeometry-win32.o \
+       gdkglobals-win32.o \
+       gdkim-win32.o \
+       gdkimage-win32.o \
+       gdkinput-win32.o \
+       gdkmain-win32.o \
+       gdkpixmap-win32.o \
+       gdkproperty-win32.o \
+       gdkpolyreg-generic.o \
+       gdkregion-generic.o \
+       gdkselection-win32.o \
+       gdkvisual-win32.o \
+       gdkwin32id.o \
+       gdkwindow-win32.o
 
 ../../config.h : ../../config.h.win32
-       $(CP) ../../config.h.win32 ../../config.h
+       cp $< $@
+
+../gdkconfig.h : ../gdkconfig.h.win32
+       cp $< $@
+
+gdkregion-generic.c: ../x11/gdkregion-generic.c
+       cp $< $@
+
+gdkpolyreg-generic.c: ../x11/gdkpolyreg-generic.c
+       cp $< $@
+
+gdkregion-generic.h: ../x11/gdkregion-generic.h
+       cp $< $@
+
+gdkpoly-generic.h: ../x11/gdkpoly-generic.h
+       cp $< $@
 
-gdkres.o : rc/gdk.rc
-       windres --include-dir rc rc/gdk.rc gdkres.o
+gdkgc-win32.o:: gdkregion-generic.h
+gdkpolyreg-generic.o:: gdkpoly-generic.h
 
-gdk-$(GTK_VER).dll : $(gdk_OBJECTS) gdk.def gdkres.o libwntab32x.a
-       $(GLIB)/build-dll gdk $(GTK_VER) gdk.def $(gdk_OBJECTS) -L $(GLIB) -lglib-$(GLIB_VER) -L . -lwntab32x -lgdi32 -luser32 -lshell32 -lole32 -luuid $(LDFLAGS) gdkres.o
+# Kludge to get the path to the win32 headers
+WIN32APIHEADERS = $(shell echo "\#include <winver.h>" | $(CC) -M -E - | tail -1 | sed -e 's![\\/]winver.h!!' | tr -d '\015')
+
+gdk-win32res.o : rc/gdk.rc gdk-build.tmp
+       m4 -DBUILDNUMBER=`cat gdk-build.tmp` <rc/gdk.rc >gdk-win32res.rc
+       windres --include-dir rc --include-dir $(WIN32APIHEADERS) gdk-win32res.rc gdk-win32res.o
+       rm gdk-build.tmp gdk-win32res.rc
+
+# The *.stamp files aren't distributed. Thus, this takes care of only
+# tml building libraries with nonzero build number.
+
+ifeq ($(wildcard gdk-build.stamp),gdk-build.stamp)
+# Magic to bump the build number
+gdk-build.tmp :
+       bash -c "read number && echo $$[number+1]" <gdk-build.stamp >gdk-build.tmp
+       cp gdk-build.tmp gdk-build.stamp
+else
+# Use zero as build number.
+gdk-build.tmp :
+       echo 0 >gdk-build.tmp
+endif
+
+libgdk-win32.a : $(gdk_win32_OBJECTS) 
+       -rm -f $@
+       $(AR) rv $@ $(gdk_win32_OBJECTS)
 
 libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
        cp $(WTKIT)/lib/i386/wntab32x.lib libwntab32x.a
@@ -100,11 +108,5 @@ libwntab32x.a : $(WTKIT)/lib/i386/wntab32x.lib
 .c.i :
        $(CC) $(CFLAGS) -E -DGDK_COMPILATION -DG_LOG_DOMAIN=\"Gdk\" $< >$@
 
-gdkrgb.c : ../gdkrgb.c
-       $(CP) ../gdkrgb.c .
-
-gdkrectangle.c : ../gdkrectangle.c
-       $(CP) ../gdkrectangle.c .
-
 clean:
        -rm *.exe *.o *.dll *.a *.exp *.base