1 | |
---|
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@ |
---|
11 | |
---|
12 | INSTALL = @INSTALL@ |
---|
13 | SHELL = @SHELL@ |
---|
14 | MKDIR_P = @MKDIR_P@ |
---|
15 | RM = rm -f |
---|
16 | VPATH = $(srcdir) |
---|
17 | |
---|
18 | build_date := $(shell date +%Y%m%d) |
---|
19 | machine := $(shell uname -m | sed 's/\ //') |
---|
20 | os := $(shell uname -s) |
---|
21 | |
---|
22 | pkg_path := $(shell dirname $(prefix)) |
---|
23 | pkg_name := $(shell basename $(prefix)) |
---|
24 | SVN_VERSION := $(shell svnversion $(srcdir)) |
---|
25 | |
---|
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 |
---|
29 | |
---|
30 | runtime_repo = https://nanohub.org/infrastructure/rappture-runtime/svn/trunk |
---|
31 | rappture_repo = https://nanohub.org/infrastructure/rappture/svn/trunk |
---|
32 | |
---|
33 | ENABLE_GUI = @ENABLE_GUI@ |
---|
34 | HAVE_FFMPEG = @HAVE_FFMPEG_LIBS@ |
---|
35 | TARGETS = src lang lib |
---|
36 | |
---|
37 | ifneq ($(ENABLE_GUI),) |
---|
38 | TARGETS += gui builder tester examples |
---|
39 | endif |
---|
40 | ifneq ($(HAVE_FFMPEG),) |
---|
41 | TARGETS += video |
---|
42 | endif |
---|
43 | |
---|
44 | .PHONY: all test install clean distclean package distrib runtime-distrib \ |
---|
45 | $(TARGETS) |
---|
46 | |
---|
47 | all: |
---|
48 | for i in $(TARGETS) ; do \ |
---|
49 | $(MAKE) -C $$i all || exit 1 ;\ |
---|
50 | done |
---|
51 | |
---|
52 | test: |
---|
53 | $(MAKE) -C test all |
---|
54 | |
---|
55 | install: |
---|
56 | for i in $(TARGETS) ; do \ |
---|
57 | $(MAKE) -C $$i install || exit 1 ;\ |
---|
58 | done |
---|
59 | |
---|
60 | clean: |
---|
61 | for i in $(TARGETS) ; do \ |
---|
62 | $(MAKE) -C $$i clean || exit 1 ;\ |
---|
63 | done |
---|
64 | |
---|
65 | distclean: clean |
---|
66 | $(RM) Makefile config.status config.log *~ |
---|
67 | for i in $(TARGETS) ; do \ |
---|
68 | $(MAKE) -C $$i distclean || exit 1 ;\ |
---|
69 | done |
---|
70 | |
---|
71 | package: |
---|
72 | tar -C $(pkg_path) -czlf $(rappture_binary_tarfile) $(pkg_name) |
---|
73 | |
---|
74 | distrib: |
---|
75 | $(RM) -r exported |
---|
76 | $(MKDIR_P) -m 0755 exported |
---|
77 | (cd exported; svn export -q $(rappture_repo) rappture) |
---|
78 | tar -C exported -czlf $(rappture_source_tarfile) rappture |
---|
79 | $(RM) -r exported |
---|
80 | |
---|
81 | runtime-distrib: |
---|
82 | $(RM) -r exported |
---|
83 | $(MKDIR_P) -m 0755 exported |
---|
84 | (cd exported; svn export -q $(runtime_repo) runtime) |
---|
85 | tar -C exported -czlf $(runtime_source_tarfile) runtime |
---|
86 | $(RM) -r exported |
---|