Makefile.plain 1.41 KB
Newer Older
1 2 3
PACKAGE = jhbuild
VERSION = 0.1

4 5
CC ?= cc
CFLAGS ?= -Wall -O2
6

7 8
MAKE ?= make

9 10
-include Makefile.inc

11
all: include-check
12 13
	@echo 'Run "make install" to install.'

14
include-check:
15
	@test -f Makefile.inc || \
16
	(echo "Makefile.inc doesn't exist. Please run autogen.sh"; exit 1)
17

18
update:
19
	git pull --rebase
20
	@if [ "x$(DISABLE_GETTEXT)" = x ]; then (cd po && $(MAKE) -f Makefile.plain); fi
21

22
install: include-check
23
	@if [ "x$(DISABLE_GETTEXT)" = x ]; then (cd po && $(MAKE) -f Makefile.plain install); fi
24 25
	@echo "Creating $(bindir)/jhbuild"
	@mkdir -p $(bindir)
26 27 28
	@sed -e "s,@jhbuilddir@,`pwd`,g" \
		-e "s,USE_CHECKOUT_SRC = False,USE_CHECKOUT_SRC = True," < \
		scripts/jhbuild.in > $(bindir)/jhbuild
29
	@chmod a+x $(bindir)/jhbuild
30 31 32

	@echo "Creating $(desktopdir)/jhbuild.desktop"
	@mkdir -p $(desktopdir)
33
	@sed "s,^_,,g;s,^Exec=.*$$,Exec=$(bindir)/jhbuild gui,;s,^X-GNOME-Bugzilla-Version=.*$$,," \
34
		< jhbuild.desktop.in.in > $(desktopdir)/jhbuild.desktop
35

36 37 38
# if ~/bin/jbuild exists, it is most likely an old version, and it will
# not work; so rename it and install a symlink to the new version
# instead.
39
# (This comment is intentionally not indented, otherwise make prints it)
40 41 42 43 44
	@if [ -e "$(HOME)/bin/jhbuild" ] && [ ! $(bindir) -ef $(HOME)/bin ]; then \
		mv "$(HOME)/bin/jhbuild" "$(HOME)/bin/jhbuild.old" ; \
		ln -s $(bindir)/jhbuild "$(HOME)/bin/jhbuild" ; \
	fi

45 46
	./scripts/debian-python2-postinstall-hook.sh $(bindir)

47
.PHONY: all update install