Index: c/src/lib/libcpu/powerpc/shared/Makefile.am
===================================================================
--- c/src/lib/libcpu/powerpc/shared/Makefile.am	(revision ba4eefd932ed022d143519c5e4a1a9ae628223a6)
+++ c/src/lib/libcpu/powerpc/shared/Makefile.am	(revision f439d61ed7d54eba50726df821aa85a7774bcb07)
@@ -3,55 +3,69 @@
 ##
 
+EXTRA_PROGRAMS =
+CLEANFILES =
+noinst_DATA =
+
 include $(top_srcdir)/../../../automake/compile.am
-include $(top_srcdir)/../../../automake/lib.am
 
 # include
 if shared
-libcpuspec_C_FILES = include/cpuIdent.c
-libcpuspec_OBJS = \
-    $(libcpuspec_C_FILES:include/%.c=include/$(ARCH)/%.$(OBJEXT))
-
 include_libcpudir = $(includedir)/libcpu
 
-include_libcpu_HEADERS = include/spr.h include/io.h include/mmu.h \
-    include/page.h include/byteorder.h include/pgtable.h include/cpuIdent.h
+include_libcpu_HEADERS = include/io.h include/mmu.h include/page.h \
+    include/byteorder.h include/pgtable.h
 
-include/$(ARCH)/$(dirstamp):
-	@$(mkdir_p) include/$(ARCH)
-	@: > include/$(ARCH)/$(dirstamp)
-include/$(ARCH)/%.$(OBJEXT): include/%.c include/$(ARCH)/$(dirstamp)
-	${COMPILE} -o $@ -c $<
-include/$(ARCH)/libcpuspec.a: $(libcpuspec_OBJS)
-	$(make-library)
-CLEANDIRS = include/o-optimize include/o-debug
+EXTRA_PROGRAMS += cpuIdent.rel
+CLEANFILES += cpuIdent.rel
+cpuIdent_rel_SOURCES = include/cpuIdent.c include/cpuIdent.h
+cpuIdent_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
+cpuIdent_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-EXTRA_DIST = $(libcpuspec_C_FILES)
+EXTRA_PROGRAMS += cpuIdent_g.rel
+CLEANFILES += cpuIdent_g.rel
+cpuIdent_g_rel_SOURCES = $(cpuIdent_rel_SOURCES)
+cpuIdent_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+cpuIdent_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-# src
+noinst_DATA += cpuIdent$(LIB_VARIANT).rel
+include_libcpu_HEADERS += include/cpuIdent.h
 
-src_C_FILES = src/cache.c src/stack.c
+## cache
+EXTRA_PROGRAMS += cache.rel
+CLEANFILES += cache.rel
+cache_rel_SOURCES = src/cache.c src/cache_.h \
+    ../../shared/src/cache_aligned_malloc.c ../../shared/src/cache_manager.c \
+    ../../shared/include/cache.h
+cache_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V) -I$(srcdir)/src
+cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-common_C_FILES = $(top_srcdir)/../shared/src/cache_aligned_malloc.c
-common_C_FILES += $(top_srcdir)/../shared/src/cache_manager.c
+EXTRA_PROGRAMS += cache_g.rel
+CLEANFILES += cache_g.rel
+cache_g_rel_SOURCES = $(cache_rel_SOURCES)
+cache_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V) -I$(srcdir)/src
+cache_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-src_O_FILES = $(src_C_FILES:src/%.c=src/$(ARCH)/%.$(OBJEXT))
-common_O_FILES = \
-    $(common_C_FILES:$(top_srcdir)/../shared/src/%.c=src/$(ARCH)/%.$(OBJEXT))
+noinst_DATA += cache$(LIB_VARIANT).rel
+include_libcpu_HEADERS += ../../shared/include/cache.h
 
-src/$(ARCH)/$(dirstamp):
-	@$(mkdir_p) src/$(ARCH)
-	@: > src/$(ARCH)/$(dirstamp)
-src/$(ARCH)/%.$(OBJEXT): $(top_srcdir)/../shared/src/%.c src/$(ARCH)/$(dirstamp)
-	${COMPILE} -I$(srcdir)/src -o $@ -c $<
-src/$(ARCH)/%.$(OBJEXT): src/%.c src/$(ARCH)/$(dirstamp)
-	${COMPILE} -I$(srcdir)/src -o $@ -c $<
-CLEANDIRS += src/o-optimize src/o-debug
+## stack
+EXTRA_PROGRAMS += stack.rel
+CLEANFILES += stack.rel
+stack_rel_SOURCES = src/stack.c include/spr.h src/stackTrace.h
+stack_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
+stack_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
 
-noinst_HEADERS = src/cache_.h
+EXTRA_PROGRAMS += stack_g.rel
+CLEANFILES += stack_g.rel
+stack_g_rel_SOURCES = $(stack_rel_SOURCES)
+stack_g_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+stack_g_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+
+noinst_DATA += stack$(LIB_VARIANT).rel
+include_libcpu_HEADERS += include/spr.h
 include_libcpu_HEADERS += src/stackTrace.h
-include_libcpu_HEADERS += $(top_srcdir)/../shared/include/cache.h
+endif
 
-all-local: $(PREINSTALL_FILES) include/$(ARCH)/libcpuspec.a $(src_O_FILES) $(common_O_FILES)
-endif
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_DIRS =
@@ -63,8 +77,4 @@
 	@: > $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
-
-$(PROJECT_INCLUDE)/libcpu/spr.h: include/spr.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/spr.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/spr.h
 
 $(PROJECT_INCLUDE)/libcpu/io.h: include/io.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
@@ -92,14 +102,18 @@
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/cpuIdent.h
 
+$(PROJECT_INCLUDE)/libcpu/cache.h: ../../shared/include/cache.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/cache.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/cache.h
+
+$(PROJECT_INCLUDE)/libcpu/spr.h: include/spr.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/spr.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/spr.h
+
 $(PROJECT_INCLUDE)/libcpu/stackTrace.h: src/stackTrace.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/stackTrace.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/stackTrace.h
-
-$(PROJECT_INCLUDE)/libcpu/cache.h: $(top_srcdir)/../shared/include/cache.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/cache.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/cache.h
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 DISTCLEANFILES = $(PREINSTALL_DIRS)
 
