summaryrefslogtreecommitdiffstats
path: root/c/src/wrapup/Makefile.am
blob: 6f8384e953d65f3366f0f63b10fd3375c8da0557 (plain)
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
76
77
78
79
##
##  $Id$
##
##  build and install "glommed" librtemsbsp.a
##

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

project_lib_DATA = $(ARCH)/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 += ../librdbg/src/$(RTEMS_CPU)/$(ARCH)/librdbg.a
endif

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

if LIBCHIP
SRCS += ../libchip/rtc/$(ARCH)/librtcio.a
SRCS += ../libchip/serial/$(ARCH)/libserialio.a
SRCS += ../libchip/ide/$(ARCH)/libide.a
if HAS_NETWORKING
SRCS += ../libchip/network/$(ARCH)/libnetchip$(LIB_VARIANT).a
endif
endif

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

all-local: $(TMPINSTALL_FILES)

$(ARCH)/librtemsbsp$(LIB_VARIANT).a: $(SRCS) $(ARCH)/$(dirstamp)
	rm -rf $(ARCH)/*.a $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel
	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)/*
	$(RANLIB) $@

$(PROJECT_LIB)/$(dirstamp):
	@$(mkdir_p) $(PROJECT_LIB)
	@: > $(PROJECT_LIB)/$(dirstamp)

$(PROJECT_LIB)/librtemsbsp$(LIB_VARIANT).a: $(ARCH)/librtemsbsp$(LIB_VARIANT).a $(PROJECT_LIB)/$(dirstamp)
	$(INSTALL_DATA) $< $(PROJECT_LIB)/librtemsbsp$(LIB_VARIANT).a
TMPINSTALL_FILES += $(PROJECT_LIB)/librtemsbsp$(LIB_VARIANT).a

include $(top_srcdir)/automake/local.am