summaryrefslogtreecommitdiffstats
path: root/c/src/wrapup/Makefile.am
blob: d31d31e676c53c53efa167075f517b0e7038833e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##
##  $Id$
##
##  build and install "glommed" librtemsbsp.a
##

include $(top_srcdir)/../../automake/compile.am
include $(top_srcdir)/../../automake/lib.am

LIB = $(PROJECT_RELEASE)/lib/librtemsbsp${LIB_VARIANT}.a

SRCS = ../support/${ARCH}/libsupport.a

if HAS_LIBBSP
SRCS += ../lib/libbsp/@RTEMS_CPU@/@RTEMS_BSP_FAMILY@/wrapup/$(ARCH)/libbsp.a
endif

if HAS_NETWORKING
SRCS += ../libnetworking/wrapup/$(ARCH)/libnetapps.a
endif

if HAS_RDBG
SRCS += $(PROJECT_RELEASE)/lib/librdbg$(LIB_VARIANT).a
endif

SRCS += $(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a)

if LIBCHIP
SRCS += ../libchip/rtc/$(ARCH)/librtcio.a
SRCS += ../libchip/serial/$(ARCH)/libserialio.a
SRCS += $(wildcard $(PROJECT_RELEASE)/lib/libnetchip$(LIB_VARIANT).a)
endif

SRCS += $(wildcard $(PROJECT_RELEASE)/lib/rtems-ctor$(LIB_VARIANT).$(OBJEXT))

TMPINSTALL_FILES += $(LIB)

all-local: $(ARCH) $(LIB) $(TMPINSTALL_FILES)

$(LIB): $(SRCS)
	rm -f $@
	rm -rf $(ARCH)/*
	test -d $(ARCH) || mkdir $(ARCH)
	for f in $(SRCS); do \
	  case $$f in \
	  *.$(OBJEXT) | *.rel) \
	    if test -f $(ARCH)/`basename $$f`; then \
	      if cmp $$f $(ARCH)/`basename $$f`; then \
		true; \
	      else \
		echo 1>&2 "ERROR -- `basename $$f` in multiple files"; \
		exit 1; \
	      fi; \
	    else \
	      cp $$f $(ARCH)/; \
	      chmod a-w $(ARCH)/`basename $$f`; \
	    fi; \
	    ;; \
	  *.a) \
	    cd $(ARCH); \
	      $(AR) xv ../$$f || exit 1; \
	      chmod a-w * ; \
            cd ..; \
	    ;; \
	  esac; \
	done
	$(AR) rc $@ $(ARCH)/*
	rm -f $(ARCH)/*
	$(RANLIB) $@

install-data-local:
	@$(mkinstalldirs) $(DESTDIR)$(bsplibdir)
	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(bsplibdir)

include $(top_srcdir)/../../automake/local.am