1 | # wrapper to build SINA together with arb |
---|
2 | # |
---|
3 | |
---|
4 | TARFILE=$(wildcard SINA-1.7.*.*gz) |
---|
5 | |
---|
6 | ARB_PATCH=arb7.patch |
---|
7 | |
---|
8 | BUILDDIR=builddir |
---|
9 | |
---|
10 | SINA_INST_BIN=$(ARBHOME)/bin/sina |
---|
11 | SINA_MADE_BIN=$(BUILDDIR)/src/sina |
---|
12 | |
---|
13 | CC = $(A_CC) |
---|
14 | CXX = $(A_CXX) |
---|
15 | |
---|
16 | # special flags needed if arb is build sanitized |
---|
17 | CFLAGS = -g -O2 $(SANI_CFLAGS) |
---|
18 | LDFLAGS =$(SANI_CLFLAGS) |
---|
19 | |
---|
20 | # hack needed until sina build properly detects libtirpc: |
---|
21 | ifdef LIBS |
---|
22 | LIBS := $(LIBS) $(ARB_RPC_LIBS) |
---|
23 | else |
---|
24 | LIBS := $(ARB_RPC_LIBS) |
---|
25 | endif |
---|
26 | |
---|
27 | # configure: |
---|
28 | CONFIGURE_OPTS := |
---|
29 | |
---|
30 | CONFIGURE_OPTS += --disable-silent-rules # be verbose |
---|
31 | CONFIGURE_OPTS += --enable-shared=no --enable-static=yes |
---|
32 | CONFIGURE_OPTS += --disable-docs # do not generate documentation |
---|
33 | CONFIGURE_OPTS += "--with-buildinfo=patched for arb r19248" # add patch info |
---|
34 | # detect revision for patchinfo using: |
---|
35 | # svn log ./builddir | head -30 | grep '^r[1-9]' | head -1 |
---|
36 | |
---|
37 | # do not warn about undefined make variables in calls to submakefiles: |
---|
38 | ARB_ORG_MAKEFLAGS:=$(subst --warn-undefined-variables,,$(ARB_ORG_MAKEFLAGS)) |
---|
39 | |
---|
40 | SUBMAKEFLAGS:=MAKEFLAGS="$(ARB_ORG_MAKEFLAGS)" LIBS="$(LIBS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
---|
41 | |
---|
42 | ## targets called by "upsteam makefile": |
---|
43 | |
---|
44 | all: $(SINA_INST_BIN) |
---|
45 | |
---|
46 | clean: |
---|
47 | rm -f *.stamp |
---|
48 | rm -f $(SINA_INST_BIN) |
---|
49 | test ! -e $(BUILDDIR)/Makefile || (export $(SUBMAKEFLAGS) ; $(MAKE) -C $(BUILDDIR) mostlyclean clean-binPROGRAMS clean-libLTLIBRARIES clean-libtool) |
---|
50 | |
---|
51 | ## internal targets |
---|
52 | |
---|
53 | build: $(SINA_MADE_BIN) |
---|
54 | |
---|
55 | # reset MAKEFLAGS to value initially found in main ARB makefile |
---|
56 | |
---|
57 | $(SINA_INST_BIN): $(SINA_MADE_BIN) |
---|
58 | cp -p $(SINA_MADE_BIN) $@ |
---|
59 | |
---|
60 | $(SINA_MADE_BIN): check_configured |
---|
61 | (export $(SUBMAKEFLAGS) ; $(MAKE) -C $(BUILDDIR)) |
---|
62 | |
---|
63 | check_configured: configure.stamp |
---|
64 | |
---|
65 | configure.stamp: Makefile |
---|
66 | ifeq ($(ARB_ORG_MAKEFLAGS),) |
---|
67 | $(error ARB_ORG_MAKEFLAGS is empty) |
---|
68 | endif |
---|
69 | ( export $(SUBMAKEFLAGS) ; \ |
---|
70 | cd $(BUILDDIR) && \ |
---|
71 | ./autogen.sh && \ |
---|
72 | ./configure $(CONFIGURE_OPTS) ) |
---|
73 | touch $@ |
---|
74 | |
---|
75 | |
---|
76 | # prevent make from deleting intermediate targets: |
---|
77 | .SECONDARY: |
---|
78 | |
---|
79 | .PHONY: clean all check_configured |
---|
80 | |
---|