[20db683] | 1 | ## |
---|
| 2 | ## $Id$ |
---|
| 3 | ## |
---|
| 4 | |
---|
[405c7d1] | 5 | LIB = $(project_libdir)$(MULTISUBDIR)/librtemscpu$(LIB_VARIANT).a |
---|
[20db683] | 6 | |
---|
[fed6210d] | 7 | include $(top_srcdir)/automake/multilib.am |
---|
| 8 | include $(top_srcdir)/automake/compile.am |
---|
| 9 | include $(top_srcdir)/automake/lib.am |
---|
[20db683] | 10 | |
---|
[2a582aa5] | 11 | if LIBSCORECPU |
---|
| 12 | CPU_OBJS = ../score/cpu/$(RTEMS_CPU)/$(ARCH)/libscorecpu.a |
---|
| 13 | endif |
---|
[3c9fa54] | 14 | CORE_OBJS = ../score/$(ARCH)/libscore.a |
---|
[25f419e] | 15 | SAPI_OBJS = ../sapi/$(ARCH)/libsapi.a |
---|
[1fd4e20] | 16 | RTEMS_OBJS = ../rtems/$(ARCH)/librtems.a |
---|
[20db683] | 17 | |
---|
| 18 | if HAS_POSIX |
---|
[89e9cc49] | 19 | POSIX_OBJS = ../posix/$(ARCH)/libposix.a |
---|
[20db683] | 20 | endif |
---|
| 21 | |
---|
| 22 | if HAS_ITRON |
---|
[89e9cc49] | 23 | ITRON_OBJS = ../itron/$(ARCH)/libitron.a |
---|
[20db683] | 24 | endif |
---|
| 25 | |
---|
[7001a48] | 26 | LIBCSUPPORT_OBJS = ../libcsupport/$(ARCH)/libcsupport.a |
---|
[90926129] | 27 | |
---|
[b55fbf5] | 28 | LIBBLOCK_OBJS = ../libblock/$(ARCH)/libblock.a |
---|
[35cd6ae] | 29 | if !UNIX |
---|
[7001a48] | 30 | LIBDOSFS_OBJS = ../libfs/src/dosfs/$(ARCH)/libdosfs.a |
---|
[35cd6ae] | 31 | endif |
---|
[7001a48] | 32 | LIBIMFS_OBJS = ../libfs/src/imfs/$(ARCH)/libimfs.a |
---|
[35cd6ae] | 33 | |
---|
[3e39b47] | 34 | if HAS_NETWORKING |
---|
| 35 | NETWORKING_OBJS = \ |
---|
[2a582aa5] | 36 | ../libnetworking/wrapup/$(ARCH)/libnetworking.a |
---|
| 37 | endif |
---|
| 38 | |
---|
| 39 | if LIBRPC |
---|
| 40 | LIBRPC_OBJS = \ |
---|
[e73e576] | 41 | ../librpc/src/rpc/$(ARCH)/librpc.a \ |
---|
[2239edfd] | 42 | ../librpc/src/xdr/$(ARCH)/libxdr.a |
---|
[3e39b47] | 43 | endif |
---|
| 44 | |
---|
[20db683] | 45 | OBJS = $(CPU_OBJS) $(CORE_OBJS) $(RTEMS_OBJS) $(SAPI_OBJS) \ |
---|
[35cd6ae] | 46 | $(POSIX_OBJS) $(ITRON_OBJS) $(LIBCSUPPORT_OBJS) \ |
---|
[3e39b47] | 47 | $(LIBBLOCK_OBJS) $(LIBDOSFS_OBJS) $(LIBIMFS_OBJS) \ |
---|
[2a582aa5] | 48 | $(NETWORKING_OBJS) $(LIBRPC_OBJS) |
---|
[20db683] | 49 | |
---|
| 50 | $(LIB): ${OBJS} |
---|
[3e39b47] | 51 | rm -f $@ |
---|
| 52 | test -d $(ARCH) || mkdir $(ARCH) |
---|
| 53 | rm -rf $(ARCH)/* |
---|
| 54 | for f in $(OBJS); do \ |
---|
| 55 | case $$f in \ |
---|
[305dd8bd] | 56 | *.$(OBJEXT) | *.rel) \ |
---|
[3e39b47] | 57 | if test -f $(ARCH)/`basename $$f`; then \ |
---|
| 58 | if cmp $$f $(ARCH)/`basename $$f`; then \ |
---|
| 59 | true; \ |
---|
| 60 | else \ |
---|
| 61 | echo 1>&2 "ERROR -- `basename $$f` in multiple files"; \ |
---|
| 62 | exit 1; \ |
---|
| 63 | fi; \ |
---|
| 64 | else \ |
---|
| 65 | cp $$f $(ARCH)/; \ |
---|
| 66 | chmod a-w $(ARCH)/`basename $$f`; \ |
---|
| 67 | fi; \ |
---|
| 68 | ;; \ |
---|
| 69 | *.a) \ |
---|
| 70 | cd $(ARCH); \ |
---|
| 71 | $(AR) xv ../$$f || exit 1; \ |
---|
| 72 | chmod a-w * ; \ |
---|
| 73 | cd ..; \ |
---|
| 74 | ;; \ |
---|
| 75 | esac; \ |
---|
| 76 | done |
---|
[405c7d1] | 77 | test -d $(project_libdir)$(MULTISUBDIR) || $(mkinstalldirs) $(project_libdir)$(MULTISUBDIR) |
---|
[3e39b47] | 78 | $(AR) rc $@ $(ARCH)/* |
---|
[305dd8bd] | 79 | rm -f $(ARCH)/*.$(OBJEXT) |
---|
[3e39b47] | 80 | $(RANLIB) $@ |
---|
[20db683] | 81 | |
---|
[405c7d1] | 82 | TMPINSTALL_FILES += $(project_libdir)$(MULTISUBDIR)/librtemscpu$(LIB_VARIANT).a |
---|
[20db683] | 83 | |
---|
[fa348b7d] | 84 | cpulibdir = $(libdir) |
---|
| 85 | cpulib_DATA = $(LIB) |
---|
[dd2906e] | 86 | |
---|
[20db683] | 87 | all-local: ${ARCH} $(TMPINSTALL_FILES) |
---|
| 88 | |
---|
[fed6210d] | 89 | include $(top_srcdir)/automake/local.am |
---|