Makefile.am 7.23 KB
Newer Older
Bruno Coudoin's avatar
Bruno Coudoin committed
1 2
## Process this file with automake to produce Makefile.in

3
if !BUILD_MINGW32
4 5 6 7 8
if TEXINFO
DOCS_SUBDIR=docs
else
DOCS_SUBDIR=
endif
9 10 11
else
DOCS_SUBDIR=
endif
12

13
SUBDIRS = po src boards $(DOCS_SUBDIR) autopackage
Bruno Coudoin's avatar
Bruno Coudoin committed
14

15 16 17
if OS_MACOSX
SUBDIRS += macosx
endif
18 19


Bruno Coudoin's avatar
Bruno Coudoin committed
20
icondir=$(datadir)/pixmaps
21
icon_DATA = gcompris.png gcompris-edit.png
Bruno Coudoin's avatar
Bruno Coudoin committed
22

23 24 25 26 27
if BUILD_MINGW32
Applicationsdir = $(datadir)/
Applications_in_files =
Applications_DATA =
else
28
Applicationsdir = $(datadir)/applications/
29 30
Applications_in_files = gcompris.desktop.in gcompris-edit.desktop.in
Applications_DATA = gcompris.desktop gcompris-edit.desktop
31
endif
Bruno Coudoin's avatar
Bruno Coudoin committed
32

33 34
@INTLTOOL_DESKTOP_RULE@

35
EXTRA_DIST = \
36
	$(Applications_in_files) \
Bruno Coudoin's avatar
Bruno Coudoin committed
37
	$(icon_DATA) \
38 39
	intltool-extract.in \
	intltool-merge.in \
40
	intltool-update.in \
41 42 43 44 45 46 47
	gnome2-macros/autogen.sh \
	gnome2-macros/compiler-flags.m4 \
	gnome2-macros/curses.m4 \
	gnome2-macros/gnome2-macros.dep \
	gnome2-macros/gnome-autogen.sh \
	gnome2-macros/gnome-common.m4 \
	gnome2-macros/gnome-deprecated-macros.m4 \
48
	README.mingw README.translators README.windows \
49 50
	config.h.mingw.in Makefile.mingw.in global_win32.mak gcompris.ico gc_admin.ico gcompris-uninstal.ico \
	gcompris-installer.nsi.in
51

Bruno Coudoin's avatar
Bruno Coudoin committed
52

53 54
distcore = $(PACKAGE)-core-$(VERSION)

Bruno Coudoin's avatar
Bruno Coudoin committed
55 56
install-data-local:
	@$(NORMAL_INSTALL)
57 58
	if test -d $(srcdir)/$(PACKAGE_DATA_DIR); then \
	  $(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/$(PACKAGE_DATA_DIR); \
59
	  cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf -  --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude "Makefile" --exclude "Makefile.am" --exclude .svn * | ( cd $(DESTDIR)/$(pkgdatadir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \
Bruno Coudoin's avatar
Bruno Coudoin committed
60 61 62
	fi

dist-hook:
63 64
	if test -d $(PACKAGE_DATA_DIR); then \
	  $(mkinstalldirs) $(distdir)/$(PACKAGE_DATA_DIR); \
65
	  cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf -  --exclude "Makefile.in" --exclude "Makefile" --exclude "*~" --exclude ".*" --exclude .svn * | ( cd ../$(distdir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \
Bruno Coudoin's avatar
Bruno Coudoin committed
66 67 68
	fi


69
CONFIG_CLEAN_FILES = gcompris.desktop gcompris-edit.desktop config.h.mingw
Bruno Coudoin's avatar
Bruno Coudoin committed
70

71
clean-local:
72
	rm -f intltool-extract intltool-merge intltool-update
Yves Combe's avatar
Yves Combe committed
73
	-rm -fr $(BUNDLE_APPDIR)
74

75 76 77 78 79 80 81
update-voices:
	@if test -d $(PACKAGE_DATA_DIR)/voices; then \
	  svn up $(PACKAGE_DATA_DIR)/voices; \
	else \
	  mkdir $(PACKAGE_DATA_DIR)/voices; \
	  svn co http://svn.gnome.org/svn/gcompris/voices $(PACKAGE_DATA_DIR)/voices; \
	fi
82

83
all-local:
Bruno Coudoin's avatar
Bruno Coudoin committed
84 85


86
ACLOCAL_AMFLAGS = -I m4
Yves Combe's avatar
Yves Combe committed
87 88 89 90 91 92 93 94 95 96

if OS_MACOSX
BUNDLE_RESOURCES_DIR=$(BUNDLE_APPDIR)/Contents/Resources
BUNDLE_EXEC_DIR=$(BUNDLE_APPDIR)/Contents/MacOS
else
BUNDLE_RESOURCES_DIR=$(BUNDLE_APPDIR)/Resources
BUNDLE_EXEC_DIR=$(BUNDLE_APPDIR)
endif

if WITH_NSBUNDLE
97 98 99 100

ETC_PANGO=etc/pango
ETC_GTK=etc/gtk-2.0
GTK_CONF_FILES=gtk.immodules gdk-pixbuf.loaders im-multipress.conf
Yves Combe's avatar
Yves Combe committed
101
PANGO_CONF_FILES=pango.modules
102 103
FONTCONFIG_PATH=etc/fonts
GTK_MODULES_PATH=lib/gtk-2.0
104
PANGO_MODULES_PATH=lib/pango
Yves Combe's avatar
Yves Combe committed
105
EXTERN_BIN= gnuchess gnucap
106 107
PYTHON_MODULES_PATH_ORIG=lib/python$(PYTHON_VERSION)
PYTHON_MODULES_PATH_DEST=lib/python
Yves Combe's avatar
Yves Combe committed
108
PLIST=Info.plist
109 110 111 112 113 114 115 116 117 118
ICON=gcompris.png

FCT_CP_TAR=function cp_tar { \
	$(INSTALL) -d $$2 ; \
	(cd $$1 ; tar cf - $$3 * )| ( cd $$2; tar xf -) ; \
	}

FCT_LDD_CP=function ldd_cp { \
	for f in $$(ldd $$1 | grep $$2 | eval "sed -e 's,^.*$$2/\(.*\) (.*$$,\1,' " ); do \
           if test ! -f $$3/$$f ; then \
119 120
                echo $(INSTALL_D)  $$2/$$f $$3/$$f ; \
                $(INSTALL_D)  $$2/$$f $$3/$$f ;\
121 122
	        ldd_cp $$3/$$f  $$2 $$3;\
           fi \
123
        done ; }
124 125 126

FCT_OTOOL_CP=function otool_cp { \
	for f in $$(otool -L $$1 | grep $$2 | eval "sed -e 's,^.*$$2/\(.*.dylib\).*$$,\1,' " ); do \
127
            echo install_name_tool -change $$2/$$f @executable_path$$4/$$f  $$1;\
Yves Combe's avatar
Yves Combe committed
128
	    install_name_tool -change $$2/$$f @executable_path$$4/$$f $$1 ; \
129
	    if test ! -f $$3/$$f ; then \
130 131 132 133 134 135
		echo "$(INSTALL) -d $$(dirname $$3/$$f)"; \
		echo "$(INSTALL) $$2/$$f $$3/$$f "; \
		$(INSTALL) -d $$(dirname $$3/$$f); \
		$(INSTALL) $$2/$$f $$3/$$f ;\
		echo "install_name_tool -id @executable_path$$4/$$f $$3/$$f";\
		install_name_tool -id @executable_path$$4/$$f $$3/$$f;\
136 137 138 139
	        otool_cp $$3/$$f $$2 $$3 $$4 ;\
            fi \
          done; \
	}
140

141 142 143 144 145 146
if OS_MACOSX
INSTALL_D=function install_d { $(INSTALL) -d $$(dirname $$2); $(INSTALL) $$1 $$2 ;}; install_d
else
INSTALL_D=$(INSTALL) -D
endif

147
nsbundle:
Yves Combe's avatar
Yves Combe committed
148 149
	$(INSTALL) -d $(BUNDLE_RESOURCES_DIR)
	$(INSTALL) -d $(BUNDLE_EXEC_DIR)
150
	$(INSTALL) -d $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)
Yves Combe's avatar
Yves Combe committed
151 152 153
	make install prefix=$(BUNDLE_RESOURCES_DIR) \
		     exec_prefix=$(BUNDLE_RESOURCES_DIR) \
	             bindir=$(BUNDLE_EXEC_DIR) \
154
	             PYTHON_PLUGIN_DIR=$(BUNDLE_RESOURCES_DIR)/share/gcompris/python
Yves Combe's avatar
Yves Combe committed
155
	mv $(BUNDLE_EXEC_DIR)/gcompris $(BUNDLE_EXEC_DIR)/$(BUNDLE_NAME)
Yves Combe's avatar
Yves Combe committed
156
if OS_MACOSX
157
	$(FCT_OTOOL_CP); otool_cp $(BUNDLE_EXEC_DIR)/$(BUNDLE_NAME) $(prefix) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR) $(NSBUNDLE_GTK_DIR)
Yves Combe's avatar
Yves Combe committed
158
else
159
	$(FCT_LDD_CP); ldd_cp $(BUNDLE_EXEC_DIR)/$(BUNDLE_NAME) $(prefix) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)
160
endif
161 162
	$(INSTALL) -d $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_GTK)
#sed -e 's,$(prefix),@{prefix},g' $(prefix)/$(ETC_PANGO)/pangorc > $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_PANGO)/pangord
163
	for f in $(GTK_CONF_FILES); do\
164
	    sed -e 's,$(prefix),@{prefix},g' $(prefix)/$(ETC_GTK)/$$f > $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_GTK)/$$f ;\
165
        done
166
	$(INSTALL) -d $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_PANGO)
Yves Combe's avatar
Yves Combe committed
167
	for f in $(PANGO_CONF_FILES); do\
168
	    sed -e 's,$(prefix),@{prefix},g' $(prefix)/$(ETC_PANGO)/$$f > $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_PANGO)/$$f ;\
Yves Combe's avatar
Yves Combe committed
169
        done
170 171
	$(INSTALL) $(top_srcdir)/macosx/pangorc $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(ETC_PANGO)/pangorc
	$(INSTALL) -d $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(FONTCONFIG_PATH)
172 173 174 175 176
	$(FCT_CP_TAR); cp_tar $(prefix)/$(FONTCONFIG_PATH) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(FONTCONFIG_PATH)
	$(INSTALL) macosx/fonts.conf $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(FONTCONFIG_PATH)
	$(FCT_CP_TAR); cp_tar $(prefix)/$(GTK_MODULES_PATH)  $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(GTK_MODULES_PATH) "--exclude include"
	$(FCT_CP_TAR); cp_tar $(prefix)/$(PANGO_MODULES_PATH) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(PANGO_MODULES_PATH)
	$(FCT_CP_TAR); cp_tar $(prefix)/$(PYTHON_MODULES_PATH_ORIG) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/$(PYTHON_MODULES_PATH_DEST)
Yves Combe's avatar
Yves Combe committed
177
	for f in $(EXTERN_BIN); do \
178
	   $(INSTALL_D)  $(prefix)/bin/$$f $(BUNDLE_RESOURCES_DIR)/bin/$$f; \
Yves Combe's avatar
Yves Combe committed
179
	done
180
if OS_MACOSX
Yves Combe's avatar
Yves Combe committed
181 182 183
	$(INSTALL) $(top_srcdir)/macosx/Info.plist $(BUNDLE_RESOURCES_DIR)/../
	$(INSTALL) $(top_srcdir)/macosx/PkgInfo $(BUNDLE_RESOURCES_DIR)/../
	$(INSTALL) $(top_srcdir)/macosx/GCompris.icns $(BUNDLE_RESOURCES_DIR)/
184 185
	$(FCT_OTOOL_CP) ; for s in $$(find  $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR)/ -name '*.so') ; do \
		otool_cp $$s $(prefix) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR) $(NSBUNDLE_GTK_DIR) ; \
186
	done
187 188
	$(FCT_OTOOL_CP) ; for s in $$(find  $(BUNDLE_RESOURCES_DIR) -name '*.so') ; do \
		otool_cp $$s $(prefix) $(BUNDLE_EXEC_DIR)$(NSBUNDLE_GTK_DIR) $(NSBUNDLE_GTK_DIR) ; \
189
	done
Yves Combe's avatar
Yves Combe committed
190 191 192 193 194 195
	echo WARNING ! I suppose SDL Framewroks installed in /Library/Frameworks
	$(FCT_CP_TAR); cp_tar /Library/Frameworks/SDL.framework $(BUNDLE_EXEC_DIR)/../Frameworks/SDL.framework
	$(FCT_CP_TAR); cp_tar /Library/Frameworks/SDL_mixer.framework $(BUNDLE_EXEC_DIR)/../Frameworks/SDL_mixer.framework
else
	$(INSTALL) $(top_srcdir)/macosx/gcompris.png $(BUNDLE_RESOURCES_DIR)/
	$(INSTALL) $(top_srcdir)/macosx/Info-gnustep.plist $(BUNDLE_RESOURCES_DIR)/
196
endif
197

Yves Combe's avatar
Yves Combe committed
198 199
endif