summaryrefslogtreecommitdiffstats
path: root/cpukit/wrapup/Makefile.am
blob: 8286752fba21c417c9c77db1ef1c46f207eb718b (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
include $(top_srcdir)/automake/multilib.am
include $(top_srcdir)/automake/compile.am

## Setup the variant build subdirectory
ARCH = o-optimize

project_lib_LIBRARIES = librtemscpu.a

$(PROJECT_LIB)/librtemscpu.a: librtemscpu.a
	$(INSTALL_DATA) $< $(PROJECT_LIB)/librtemscpu.a
TMPINSTALL_FILES = $(PROJECT_LIB)/librtemscpu.a

librtemscpu_a_SOURCES =

TMP_LIBS =
TMP_LIBS += ../score/cpu/@RTEMS_CPU@/libscorecpu.a
TMP_LIBS += ../libcpukit.a

librtemscpu.a: $(TMP_LIBS)
	$(AM_V_GEN)rm -f $@
	$(AM_V_GEN)$(MKDIR_P) $(ARCH)
	$(AM_V_GEN)rm -rf $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel
	$(AM_V_at)for f in $(TMP_LIBS); 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 > /dev/null || exit 1; \
	      chmod a-w * ; \
            cd ..; \
	    ;; \
	  esac; \
	done
	$(AM_V_GEN)ls $(ARCH)/* > $@-list
	$(AM_V_AR)$(AR) rc $@ @$@-list
	$(AM_V_GEN)rm -f $@-list $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel
	$(AM_V_at)$(RANLIB) $@

all-local: $(TMPINSTALL_FILES)

include $(top_srcdir)/automake/local.am