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