1 | ## |
---|
2 | ## $Id$ |
---|
3 | ## |
---|
4 | ## build and install "glommed" librtemsbsp.a |
---|
5 | ## |
---|
6 | |
---|
7 | include $(top_srcdir)/../../automake/compile.am |
---|
8 | include $(top_srcdir)/../../automake/lib.am |
---|
9 | |
---|
10 | LIB = $(PROJECT_RELEASE)/lib/librtemsbsp${LIB_VARIANT}.a |
---|
11 | |
---|
12 | SRCS = ../support/${ARCH}/libsupport.a |
---|
13 | |
---|
14 | if HAS_LIBBSP |
---|
15 | SRCS += ../lib/libbsp/@RTEMS_CPU@/@RTEMS_BSP_FAMILY@/wrapup/$(ARCH)/libbsp.a |
---|
16 | endif |
---|
17 | |
---|
18 | if HAS_NETWORKING |
---|
19 | SRCS += ../libnetworking/wrapup/$(ARCH)/libnetapps.a |
---|
20 | endif |
---|
21 | |
---|
22 | if HAS_RDBG |
---|
23 | SRCS += $(PROJECT_RELEASE)/lib/librdbg$(LIB_VARIANT).a |
---|
24 | endif |
---|
25 | |
---|
26 | SRCS += $(wildcard $(PROJECT_RELEASE)/lib/libcpu$(LIB_VARIANT).a) |
---|
27 | |
---|
28 | if LIBCHIP |
---|
29 | SRCS += ../libchip/rtc/$(ARCH)/librtcio.a |
---|
30 | SRCS += ../libchip/serial/$(ARCH)/libserialio.a |
---|
31 | SRCS += ../libchip/ide/$(ARCH)/libide.a |
---|
32 | SRCS += $(wildcard $(PROJECT_RELEASE)/lib/libnetchip$(LIB_VARIANT).a) |
---|
33 | endif |
---|
34 | |
---|
35 | SRCS += $(wildcard $(PROJECT_RELEASE)/lib/rtems-ctor$(LIB_VARIANT).$(OBJEXT)) |
---|
36 | |
---|
37 | TMPINSTALL_FILES += $(LIB) |
---|
38 | |
---|
39 | all-local: $(ARCH) $(LIB) $(TMPINSTALL_FILES) |
---|
40 | |
---|
41 | $(LIB): $(SRCS) |
---|
42 | rm -f $@ |
---|
43 | rm -rf $(ARCH)/* |
---|
44 | test -d $(ARCH) || mkdir $(ARCH) |
---|
45 | for f in $(SRCS); do \ |
---|
46 | case $$f in \ |
---|
47 | *.$(OBJEXT) | *.rel) \ |
---|
48 | if test -f $(ARCH)/`basename $$f`; then \ |
---|
49 | if cmp $$f $(ARCH)/`basename $$f`; then \ |
---|
50 | true; \ |
---|
51 | else \ |
---|
52 | echo 1>&2 "ERROR -- `basename $$f` in multiple files"; \ |
---|
53 | exit 1; \ |
---|
54 | fi; \ |
---|
55 | else \ |
---|
56 | cp $$f $(ARCH)/; \ |
---|
57 | chmod a-w $(ARCH)/`basename $$f`; \ |
---|
58 | fi; \ |
---|
59 | ;; \ |
---|
60 | *.a) \ |
---|
61 | cd $(ARCH); \ |
---|
62 | $(AR) xv ../$$f || exit 1; \ |
---|
63 | chmod a-w * ; \ |
---|
64 | cd ..; \ |
---|
65 | ;; \ |
---|
66 | esac; \ |
---|
67 | done |
---|
68 | $(AR) rc $@ $(ARCH)/* |
---|
69 | rm -f $(ARCH)/* |
---|
70 | $(RANLIB) $@ |
---|
71 | |
---|
72 | install-data-local: |
---|
73 | @$(mkinstalldirs) $(DESTDIR)$(bsplibdir) |
---|
74 | $(INSTALL_DATA) $(LIB) $(DESTDIR)$(bsplibdir) |
---|
75 | |
---|
76 | include $(top_srcdir)/../../automake/local.am |
---|