1 | ## |
---|
2 | ## $Id$ |
---|
3 | ## |
---|
4 | |
---|
5 | include $(top_srcdir)/automake/multilib.am |
---|
6 | include $(top_srcdir)/automake/compile.am |
---|
7 | include $(top_srcdir)/automake/lib.am |
---|
8 | |
---|
9 | project_lib_DATA = $(ARCH)/librtemscpu$(LIB_VARIANT).a |
---|
10 | |
---|
11 | LIBS = |
---|
12 | if LIBSCORECPU |
---|
13 | LIBS += ../score/cpu/$(RTEMS_CPU)/$(ARCH)/libscorecpu.a |
---|
14 | endif |
---|
15 | LIBS += ../score/$(ARCH)/libscore.a |
---|
16 | LIBS += ../sapi/$(ARCH)/libsapi.a |
---|
17 | LIBS += ../rtems/$(ARCH)/librtems.a |
---|
18 | |
---|
19 | if HAS_POSIX |
---|
20 | LIBS += ../posix/$(ARCH)/libposix.a |
---|
21 | endif |
---|
22 | |
---|
23 | if HAS_ITRON |
---|
24 | LIBS += ../itron/$(ARCH)/libitron.a |
---|
25 | endif |
---|
26 | |
---|
27 | LIBS += ../libcsupport/$(ARCH)/libcsupport.a |
---|
28 | |
---|
29 | LIBS += ../libblock/$(ARCH)/libblock.a |
---|
30 | if !UNIX |
---|
31 | LIBS += ../libfs/src/dosfs/$(ARCH)/libdosfs.a |
---|
32 | endif |
---|
33 | LIBS += ../libfs/src/imfs/$(ARCH)/libimfs.a |
---|
34 | |
---|
35 | LIBS += ../libmisc/monitor/$(ARCH)/libmonitor.a |
---|
36 | LIBS += ../libmisc/untar/$(ARCH)/libuntar.a |
---|
37 | LIBS += ../libmisc/stackchk/$(ARCH)/libstackchk.a |
---|
38 | LIBS += ../libmisc/cpuuse/$(ARCH)/libcpuuse.a |
---|
39 | LIBS += ../libmisc/rtmonuse/$(ARCH)/librtmonuse.a |
---|
40 | |
---|
41 | ## XXX temporarily removed because it causes a |
---|
42 | ## XXX number of BSPs to not link "main(){}" used by autoconf |
---|
43 | # if LIBSERDBG |
---|
44 | # LIBS += ../libmisc/serdbg/$(ARCH)/libserdbg.a |
---|
45 | # endif |
---|
46 | |
---|
47 | if LIBSHELL |
---|
48 | LIBS += ../libmisc/shell/$(ARCH)/libshell.a |
---|
49 | endif |
---|
50 | |
---|
51 | LIBS += ../libmisc/dumpbuf/$(ARCH)/libdumpbuf.a |
---|
52 | LIBS += ../libmisc/devnull/$(ARCH)/libdevnull.a |
---|
53 | LIBS += ../libmisc/dummy/$(ARCH)/libdummy.a |
---|
54 | LIBS += ../libmisc/mw-fb/$(ARCH)/libmw-fb.a |
---|
55 | LIBS += ../libmisc/capture/$(ARCH)/libcapture.a |
---|
56 | LIBS += ../libmisc/fsmount/$(ARCH)/libfsmount.a |
---|
57 | |
---|
58 | if HAS_NETWORKING |
---|
59 | LIBS += ../libnetworking/$(ARCH)/libnetworking.a |
---|
60 | LIBS += ../libnetworking/lib/$(ARCH)/lib.a |
---|
61 | LIBS += ../libnetworking/libc/$(ARCH)/lib.a |
---|
62 | endif |
---|
63 | |
---|
64 | if LIBRPC |
---|
65 | LIBS += ../librpc/src/rpc/$(ARCH)/librpc.a |
---|
66 | LIBS += ../librpc/src/xdr/$(ARCH)/libxdr.a |
---|
67 | endif |
---|
68 | |
---|
69 | $(LIBS): $(ARCH)/$(dirstamp) |
---|
70 | |
---|
71 | $(ARCH)/librtemscpu$(LIB_VARIANT).a: ${LIBS} |
---|
72 | rm -f $@ |
---|
73 | rm -rf $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel |
---|
74 | for f in $(LIBS); do \ |
---|
75 | case $$f in \ |
---|
76 | *.$(OBJEXT) | *.rel) \ |
---|
77 | if test -f $(ARCH)/`basename $$f`; then \ |
---|
78 | if cmp $$f $(ARCH)/`basename $$f`; then \ |
---|
79 | true; \ |
---|
80 | else \ |
---|
81 | echo 1>&2 "ERROR -- `basename $$f` in multiple files"; \ |
---|
82 | exit 1; \ |
---|
83 | fi; \ |
---|
84 | else \ |
---|
85 | cp $$f $(ARCH)/; \ |
---|
86 | chmod a-w $(ARCH)/`basename $$f`; \ |
---|
87 | fi; \ |
---|
88 | ;; \ |
---|
89 | *.a) \ |
---|
90 | cd $(ARCH); \ |
---|
91 | $(AR) xv ../$$f || exit 1; \ |
---|
92 | chmod a-w * ; \ |
---|
93 | cd ..; \ |
---|
94 | ;; \ |
---|
95 | esac; \ |
---|
96 | done |
---|
97 | $(AR) rc $@ $(ARCH)/* |
---|
98 | rm -f $(ARCH)/*.$(OBJEXT) $(ARCH)/*.rel |
---|
99 | $(RANLIB) $@ |
---|
100 | |
---|
101 | all-local: $(TMPINSTALL_FILES) |
---|
102 | |
---|
103 | ${PROJECT_RELEASE}/lib/$(dirstamp): |
---|
104 | @$(mkinstalldirs) ${PROJECT_RELEASE}/lib |
---|
105 | @: > ${PROJECT_RELEASE}/lib/$(dirstamp) |
---|
106 | TMPINSTALL_FILES += ${PROJECT_RELEASE}/lib/$(dirstamp) |
---|
107 | |
---|
108 | ${PROJECT_RELEASE}/lib/librtemscpu$(LIB_VARIANT).a: $(ARCH)/librtemscpu$(LIB_VARIANT).a ${PROJECT_RELEASE}/lib/$(dirstamp) |
---|
109 | $(INSTALL_DATA) $< ${PROJECT_RELEASE}/lib/librtemscpu$(LIB_VARIANT).a |
---|
110 | TMPINSTALL_FILES += ${PROJECT_RELEASE}/lib/librtemscpu$(LIB_VARIANT).a |
---|
111 | |
---|
112 | include $(top_srcdir)/automake/local.am |
---|