Makefile.am 6.3 KB
Newer Older
1
## Makefile.am for gtk+/gdk
Elliot Lee's avatar
Elliot Lee committed
2

3
SUBDIRS=$(gdktarget)
4
DIST_SUBDIRS=linux-fb win32 x11
Tor Lillqvist's avatar
Tor Lillqvist committed
5

6 7 8 9 10
EXTRA_DIST =			\
	gdkconfig.h.win32 	\
	gdk.def 		\
	makefile.mingw 		\
	makefile.mingw.in 	\
Tim Janik's avatar
Tim Janik committed
11
	makeenums.pl		\
12
	makefile.msc
13

Owen Taylor's avatar
Owen Taylor committed
14 15 16 17 18 19
common_includes = @STRIP_BEGIN@ 	\
	-DG_LOG_DOMAIN=\"Gdk\"		\
	-I$(top_srcdir)			\
	-I$(top_builddir)/gdk		\
	-I$(top_srcdir)/gdk-pixbuf 	\
	@GTK_DEBUG_FLAGS@ 		\
20
	@GDK_DEP_CFLAGS@		\
Tor Lillqvist's avatar
Tor Lillqvist committed
21
	-DGDK_COMPILATION		\
22 23
@STRIP_END@

24 25
INCLUDES = $(common_includes)
gtarget=@gdktarget@
Elliot Lee's avatar
Elliot Lee committed
26

Tor Lillqvist's avatar
Tor Lillqvist committed
27 28 29 30 31 32
if PLATFORM_WIN32
no_undefined = -no-undefined

if HAVE_WINTAB
wintab_lib = -Lwin32 -lwntab32x
endif
33 34 35 36

if HAVE_IE55
ie55uuid_lib = -Lwin32 -lie55uuid
endif
Tor Lillqvist's avatar
Tor Lillqvist committed
37 38 39 40 41 42
endif

if OS_WIN32
gdk_win32_symbols = -export-symbols gdk.def

install-libtool-import-lib:
Owen Taylor's avatar
Owen Taylor committed
43
	$(INSTALL) .libs/libgdk-win32-$(GTK_API_VERSION).dll.a $(DESTDIR)$(libdir)
Tor Lillqvist's avatar
Tor Lillqvist committed
44
uninstall-libtool-import-lib:
45
	-rm $(DESTDIR)$(libdir)/libgdk-win32-$(GTK_API_VERSION).dll.a
Tor Lillqvist's avatar
Tor Lillqvist committed
46 47 48 49 50 51
else
install-libtool-import-lib:
uninstall-libtool-import-lib:
endif

if MS_LIB_AVAILABLE
Owen Taylor's avatar
Owen Taylor committed
52
noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib
Tor Lillqvist's avatar
Tor Lillqvist committed
53

Owen Taylor's avatar
Owen Taylor committed
54 55
gdk-win32-$(GTK_API_VERSION).lib: libgdk-win32-$(GTK_API_VERSION).la gdk.def
	lib -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
Tor Lillqvist's avatar
Tor Lillqvist committed
56 57

install-ms-lib:
Owen Taylor's avatar
Owen Taylor committed
58
	$(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
Tor Lillqvist's avatar
Tor Lillqvist committed
59 60

uninstall-ms-lib:
Owen Taylor's avatar
Owen Taylor committed
61
	-rm $(DESTDIR)$(libdir)/gdk-win32-$(GTK_API_VERSION).lib
Tor Lillqvist's avatar
Tor Lillqvist committed
62 63 64 65 66
else
install-ms-lib:
uninstall-ms-lib:
endif

67
# libtool stuff: set version and export symbols for resolving
68 69
# since automake doesn't support conditionalized libsomething_la_LDFLAGS
# we use the general approach here
Owen Taylor's avatar
Owen Taylor committed
70 71 72 73 74 75
LDFLAGS = @STRIP_BEGIN@ 						\
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) 		\
	-export-dynamic 						\
	-rpath $(libdir) 						\
	$(no_undefined)							\
	@LIBTOOL_EXPORT_OPTIONS@					\
76
	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
Owen Taylor's avatar
Owen Taylor committed
77 78
	$(gdk_win32_symbols)						\
	@GDK_DEP_LIBS@							\
79 80 81 82 83
@STRIP_END@

#
# setup source file variables
#
Owen Taylor's avatar
Started  
Owen Taylor committed
84
#
85
# GDK header files for public installation (non-generated)
Owen Taylor's avatar
Started  
Owen Taylor committed
86 87 88
#
# Note: files added here may need to be be propagated to gdk_headers in gtk/Makefile.am
#
89 90
gdk_public_h_sources = @STRIP_BEGIN@ \
	gdk.h		\
Owen Taylor's avatar
Started  
Owen Taylor committed
91 92 93 94 95 96 97
	gdkcolor.h	\
	gdkcursor.h     \
	gdkdnd.h	\
	gdkdrawable.h	\
	gdkevents.h	\
	gdkfont.h	\
	gdkgc.h		\
98
	gdkkeysyms.h	\
Owen Taylor's avatar
Started  
Owen Taylor committed
99 100 101
	gdki18n.h	\
	gdkimage.h	\
	gdkinput.h	\
Havoc Pennington's avatar
Havoc Pennington committed
102
	gdkkeys.h	\
103
	gdkpango.h	\
Owen Taylor's avatar
Owen Taylor committed
104
	gdkpixbuf.h	\
Owen Taylor's avatar
Started  
Owen Taylor committed
105 106 107 108 109
	gdkpixmap.h	\
	gdkproperty.h	\
	gdkregion.h	\
	gdkrgb.h	\
	gdkselection.h	\
110
	gdktypes.h	\
Owen Taylor's avatar
Started  
Owen Taylor committed
111 112
	gdkvisual.h	\
	gdkwindow.h	\
113 114
	gdkdisplay.h	\
	gdkscreen.h	\
115
@STRIP_END@
116

117 118 119 120 121 122
gdk_headers = @STRIP_BEGIN@       \
	$(gdk_public_h_sources)   \
	gdkenumtypes.h		  \
	gdkprivate.h		  \
@STRIP_END@

123 124 125 126 127 128 129 130 131
gdk_c_sources = @STRIP_BEGIN@ 	\
	gdk.c			\
	gdkcolor.c		\
	gdkcursor.c		\
	gdkdraw.c		\
	gdkevents.c     	\
	gdkfont.c		\
	gdkgc.c			\
	gdkglobals.c		\
Havoc Pennington's avatar
Havoc Pennington committed
132
	gdkkeys.c		\
133 134 135 136
	gdkkeyuni.c		\
	gdkimage.c		\
	gdkinternals.h  	\
	gdkpango.c		\
Owen Taylor's avatar
Owen Taylor committed
137 138
	gdkpixbuf-drawable.c	\
	gdkpixbuf-render.c	\
139
	gdkpixmap.c		\
140 141
	gdkpoly-generic.h	\
	gdkpolyreg-generic.c	\
142 143
	gdkrgb.c		\
	gdkrectangle.c		\
144 145
	gdkregion-generic.c	\
	gdkregion-generic.h	\
146 147
	gdkselection.c		\
	gdkvisual.c		\
148
	gdkwindow.c		\
149 150
	gdkdisplay.c		\
	gdkscreen.c		\
151 152 153 154 155
@STRIP_END@

#
# setup GDK sources and their dependancies
#
156

157 158
gdkincludedir = $(includedir)/gtk-2.0/gdk
gdkinclude_HEADERS = $(gdk_headers)
159

Owen Taylor's avatar
Owen Taylor committed
160 161 162
libgdk_x11_2_0_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
libgdk_linux_fb_2_0_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
libgdk_win32_2_0_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
Tor Lillqvist's avatar
Tor Lillqvist committed
163

Owen Taylor's avatar
Owen Taylor committed
164 165 166
libgdk_x11_2_0_la_LIBADD = x11/libgdk-x11.la	
libgdk_linux_fb_2_0_la_LIBADD = linux-fb/libgdk-linux-fb.la	
libgdk_win32_2_0_la_LIBADD = \
167
	win32/libgdk-win32.la $(wintab_lib) $(ie55uuid_lib)
Tor Lillqvist's avatar
Tor Lillqvist committed
168

169
lib_LTLIBRARIES = $(gdktargetlib)
170

Owen Taylor's avatar
Owen Taylor committed
171
EXTRA_LTLIBRARIES = libgdk-x11-2.0.la libgdk-linux-fb-2.0.la libgdk-win32-2.0.la
172

173
MAINTAINERCLEANFILES = gdkenumtypes.h stamp-gdkenumtypes.h
Matt Wilson's avatar
Matt Wilson committed
174
EXTRA_HEADERS =
175 176 177 178

#
# Rule to install gdkconfig.h header file
#
179
configexecincludedir = $(libdir)/gtk-2.0/include
180
#configexecinclude_DATA = gdkconfig.h
181

182
install-exec-local: gdkconfig.h
183 184 185 186
	$(mkinstalldirs) $(DESTDIR)$(configexecincludedir)
	file=$(DESTDIR)$(configexecincludedir)/gdkconfig.h; \
	if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
	else $(INSTALL_DATA) gdkconfig.h $$file; fi
187

188 189 190 191 192
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gdktargetlib)
endif

193
#note: not gdkconfig.h
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
BUILT_SOURCES = stamp-gc-h @REBUILD@ gdkenumtypes.h

# Generate built header without using automake-1.4 BUILT_SOURCES
$(libgdk_x11_2_0_la_OBJECTS) $(libgdk_linux_fb_2_0_la_OBJECTS) $(libgdk_win32_2_0_la_OBJECTS): gdkenumtypes.h

$(srcdir)/gdkenumtypes.h: stamp-gdkenumtypes.h
	@true
stamp-gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) Makefile
	( cd $(srcdir) && glib-mkenums \
			--fhead "#ifndef __GDK_ENUM_TYPES_H__\n#define __GDK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
			--fprod "/* enumerations from \"@filename@\" */\n" \
			--vhead "GType @enum_name@_get_type (void);\n#define GDK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
			--ftail "G_END_DECLS\n\n#endif /* __GDK_ENUM_TYPES_H__ */" \
		$(gdk_public_h_sources) ) >> xgen-geth \
	&& (cmp -s xgen-geth $(srcdir)/gdkenumtypes.h || cp xgen-geth $(srcdir)/gdkenumtypes.h ) \
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)
$(srcdir)/gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) Makefile
	( cd $(srcdir) && glib-mkenums \
			--fhead "#define GDK_ENABLE_BROKEN\n#include \"gdk.h\"" \
			--fprod "\n/* enumerations from \"@filename@\" */" \
			--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
		$(gdk_public_h_sources) ) > xgen-getc \
	&& cp xgen-getc $(srcdir)/gdkenumtypes.c  \
	&& rm -f xgen-getc
221

222
gdkconfig.h: stamp-gc-h
223 224
	@if test -f gdkconfig.h; then :; \
	else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
225 226 227 228
stamp-gc-h: ../config.status
	cd .. && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=gdk/gdkconfig.h ./config.status
	echo timestamp > stamp-gc-h

229
install-data-local: install-ms-lib install-libtool-import-lib
Tor Lillqvist's avatar
Tor Lillqvist committed
230 231 232

uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib

Elliot Lee's avatar
Elliot Lee committed
233 234 235 236 237 238
.PHONY: files

files:
	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
	  echo $$p; \
	done