[512] | 1 | |
---|
[4146] | 2 | bindir = @bindir@ |
---|
| 3 | datadir = @datadir@ |
---|
| 4 | datarootdir = @datarootdir@ |
---|
| 5 | exec_prefix = @exec_prefix@ |
---|
| 6 | includedir = @includedir@ |
---|
| 7 | libdir = @libdir@ |
---|
| 8 | mandir = @mandir@ |
---|
| 9 | prefix = @prefix@ |
---|
| 10 | srcdir = @srcdir@ |
---|
[708] | 11 | |
---|
[4146] | 12 | INSTALL = @INSTALL@ |
---|
| 13 | SHELL = @SHELL@ |
---|
| 14 | MKDIR_P = @MKDIR_P@ |
---|
| 15 | RM = rm -f |
---|
| 16 | VPATH = $(srcdir) |
---|
[708] | 17 | |
---|
[4146] | 18 | build_date := $(shell date +%Y%m%d) |
---|
| 19 | machine := $(shell uname -m | sed 's/\ //') |
---|
| 20 | os := $(shell uname -s) |
---|
[512] | 21 | |
---|
[4146] | 22 | pkg_path := $(shell dirname $(prefix)) |
---|
| 23 | pkg_name := $(shell basename $(prefix)) |
---|
[5811] | 24 | SVN_VERSION := $(shell readlink -e $(srcdir) | xargs svnversion | sed 's/Unversioned directory/unknown/') |
---|
[498] | 25 | |
---|
[4146] | 26 | rappture_binary_tarfile = rappture-$(os)-$(machine)-$(build_date).tar.gz |
---|
| 27 | rappture_source_tarfile = rappture-src-$(build_date).tar.gz |
---|
| 28 | runtime_source_tarfile = rappture-runtime-src-$(build_date).tar.gz |
---|
[1189] | 29 | |
---|
[4146] | 30 | runtime_repo = https://nanohub.org/infrastructure/rappture-runtime/svn/trunk |
---|
| 31 | rappture_repo = https://nanohub.org/infrastructure/rappture/svn/trunk |
---|
[1189] | 32 | |
---|
[4146] | 33 | ENABLE_GUI = @ENABLE_GUI@ |
---|
| 34 | ENABLE_LANG = @ENABLE_LANG@ |
---|
| 35 | HAVE_FFMPEG = @HAVE_FFMPEG_LIBS@ |
---|
| 36 | TARGETS = src lib |
---|
[1132] | 37 | |
---|
[4146] | 38 | ifneq ($(ENABLE_LANG),) |
---|
| 39 | TARGETS += lang |
---|
[4116] | 40 | endif |
---|
[4146] | 41 | ifneq ($(ENABLE_GUI),) |
---|
[6021] | 42 | TARGETS += gui builder tester examples puq |
---|
[718] | 43 | endif |
---|
[4146] | 44 | ifneq ($(HAVE_FFMPEG),) |
---|
| 45 | TARGETS += video |
---|
| 46 | endif |
---|
[489] | 47 | |
---|
[4146] | 48 | .PHONY: all test install clean distclean package distrib runtime-distrib \ |
---|
| 49 | $(TARGETS) |
---|
[511] | 50 | |
---|
[4146] | 51 | all: |
---|
| 52 | for i in $(TARGETS) ; do \ |
---|
| 53 | $(MAKE) -C $$i all || exit 1 ;\ |
---|
| 54 | done |
---|
[3736] | 55 | |
---|
[4146] | 56 | test: |
---|
| 57 | $(MAKE) -C test all |
---|
[511] | 58 | |
---|
[6021] | 59 | install: |
---|
[4146] | 60 | for i in $(TARGETS) ; do \ |
---|
| 61 | $(MAKE) -C $$i install || exit 1 ;\ |
---|
| 62 | done |
---|
[489] | 63 | |
---|
[6021] | 64 | clean: |
---|
[4146] | 65 | for i in $(TARGETS) ; do \ |
---|
| 66 | $(MAKE) -C $$i clean || exit 1 ;\ |
---|
| 67 | done |
---|
[489] | 68 | |
---|
[4146] | 69 | distclean: clean |
---|
| 70 | $(RM) Makefile config.status config.log *~ |
---|
| 71 | for i in $(TARGETS) ; do \ |
---|
| 72 | $(MAKE) -C $$i distclean || exit 1 ;\ |
---|
| 73 | done |
---|
[1018] | 74 | |
---|
[6021] | 75 | package: |
---|
[4146] | 76 | tar -C $(pkg_path) -czlf $(rappture_binary_tarfile) $(pkg_name) |
---|
[1183] | 77 | |
---|
[6021] | 78 | distrib: |
---|
[4146] | 79 | $(RM) -r exported |
---|
| 80 | $(MKDIR_P) -m 0755 exported |
---|
| 81 | (cd exported; svn export -q $(rappture_repo) rappture) |
---|
| 82 | tar -C exported -czlf $(rappture_source_tarfile) rappture |
---|
| 83 | $(RM) -r exported |
---|
[1189] | 84 | |
---|
[4146] | 85 | runtime-distrib: |
---|
| 86 | $(RM) -r exported |
---|
| 87 | $(MKDIR_P) -m 0755 exported |
---|
| 88 | (cd exported; svn export -q $(runtime_repo) runtime) |
---|
| 89 | tar -C exported -czlf $(runtime_source_tarfile) runtime |
---|
| 90 | $(RM) -r exported |
---|