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