summaryrefslogtreecommitdiff
path: root/common.mk
blob: 5c62641cd852008cc4decf92ae1210a6a786b907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# guile-gnome
# Copyright (C) 2003,2004,2009,2012,2013 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or    
# modify it under the terms of the GNU General Public License as   
# published by the Free Software Foundation; either version 2 of   
# the License, or (at your option) any later version.              

# This program is distributed in the hope that it will be useful,  
# but WITHOUT ANY WARRANTY; without even the implied warranty of   
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
# GNU General Public License for more details.                     

# You should have received a copy of the GNU General Public License
# along with this program; if not, contact:

# Free Software Foundation           Voice:  +1-617-542-5942
# 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
# Boston, MA  02111-1307,  USA       gnu@gnu.org


#
# Makefile snippet
#

guilegnomedir = $(datadir)/guile-gnome-@API_VERSION@
guilemoduledir = $(guilegnomedir)/gnome
guilegwmoduledir = $(guilegnomedir)/gnome/gw

guilegnomelibdir = $(libdir)/guile-gnome-@API_VERSION@

AM_CFLAGS = -I. -I$(srcdir) $(WARN_CFLAGS) $(DEBUG_CFLAGS)

# For overriding from the command line (e.g. --debug)
GUILE_FLAGS = 

SUFFIXES = .x .doc

GUILE_SNARF_CFLAGS = $(DEFS) $(AM_CFLAGS) $(GUILE_CFLAGS) $(G_WRAP_CFLAGS)

PACKAGES = atk cairo corba defs gconf glib gnome-vfs gtk libglade libgnome libgnomecanvas libgnomeui pango
SOURCE_GUILE_PATH=$(shell echo $(addprefix $(abs_top_srcdir)/,$(PACKAGES)) | sed -e 's/ /:/g'):$(srcdir)
BUILD_GUILE_PATH=$(if $(filter-out $(abs_top_srcdir),$(abs_top_builddir)),$(shell echo -n $(addprefix $(abs_top_builddir)/,$(PACKAGES)): | sed -e 's/ /:/g'),)
GUILE_LOAD_PATH:=$(BUILD_GUILE_PATH)$(SOURCE_GUILE_PATH):${G_WRAP_MODULE_DIR}$(if ${GUILE_LOAD_PATH},:${GUILE_LOAD_PATH})
export GUILE_LOAD_PATH

.c.x:
	guile-snarf $(GUILE_SNARF_CFLAGS) $< > $@ \
	|| { rm $@; false; }
.c.doc:
	$(CPP) -DSCM_MAGIC_SNARF_DOCS $(GUILE_SNARF_CFLAGS) $< \
	  | grep -E '(\^\^ {|\^\^ })' > $@ || { rm $@; false; }

%.scm guile-gnome-gw-%.c: %-spec.scm
	guile $(GUILE_FLAGS) -c \
	  "(debug-set! stack 400000) \
	   (use-modules (gnome-@API_VERSION@)) \
	   (use-modules (g-wrap)) \
	   (use-modules (gnome gw $*-spec)) \
	   (generate-wrapset 'guile 'gnome-$* \"guile-gnome-gw-$*\")"
	mv guile-gnome-gw-$*.scm $*.scm

%-@API_VERSION@.pc: %.pc
	cp $< $@
%-@API_VERSION@-uninstalled.pc: %-uninstalled.pc
	cp $< $@

# Real gnu make foo
packages = $(filter-out %-uninstalled,$(patsubst %.pc.in,%,$(notdir $(wildcard $(srcdir)/*.pc.in))))
pcifiles = $(patsubst %,%-@API_VERSION@.pc,$(packages))
pcufiles = $(patsubst %,%-@API_VERSION@-uninstalled.pc,$(packages))