Index: c/src/exec/sapi/macros/rtems/Makefile.am
===================================================================
--- c/src/exec/sapi/macros/rtems/Makefile.am	(revision 9608320702e8dba9947987cd34001824638c434e)
+++ c/src/exec/sapi/macros/rtems/Makefile.am	(revision fba12eb6ff4a91fcbac1c43dd3196114cc12756b)
@@ -5,9 +5,9 @@
 AUTOMAKE_OPTIONS = foreign 1.4
 
-if MACROS
 I_FILES = extension.inl
 
 noinst_HEADERS = $(I_FILES)
 
+if MACROS
 PREINSTALL_FILES = \
 $(PROJECT_INCLUDE)/rtems \
Index: c/src/exec/sapi/optman/Makefile.am
===================================================================
--- c/src/exec/sapi/optman/Makefile.am	(revision fba12eb6ff4a91fcbac1c43dd3196114cc12756b)
+++ c/src/exec/sapi/optman/Makefile.am	(revision fba12eb6ff4a91fcbac1c43dd3196114cc12756b)
@@ -0,0 +1,39 @@
+##
+##  $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+C_FILES = no-ext.c no-io.c
+C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
+
+SRCS = $(C_FILES)
+OBJS = $(C_O_FILES)
+
+PGMNAME = $(C_FILES:%.c=%)
+PGMS = $(C_FILES:%.c=$(ARCH)/%.rel)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(RTEMS_ROOT)/make/leaf.cfg
+
+TMPINSTALL_FILES = \
+$(PROJECT_RELEASE)/lib \
+$(PGMNAME:%=$(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel)
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+AM_CFLAGS += $(CFLAGS_OS_V)
+ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
+
+$(PROJECT_RELEASE)/lib:
+	$(mkinstalldirs) $@
+$(PROJECT_RELEASE)/lib/%$(LIB_VARIANT).rel: $(ARCH)/%.rel
+	$(INSTALL_DATA) $< $@
+
+all: ${ARCH} $(TMPINSTALL_FILES)
+
+EXTRA_DIST = $(C_FILES)
+
+include $(top_srcdir)/../../../automake/local.am
Index: c/src/exec/sapi/optman/Makefile.in
===================================================================
--- c/src/exec/sapi/optman/Makefile.in	(revision 9608320702e8dba9947987cd34001824638c434e)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#
-#  $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ../..
-subdir = sapi/optman
-
-RTEMS_ROOT = @RTEMS_ROOT@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-VPATH = @srcdir@
-
-C_FILES = no-ext.c no-io.c
-
-H_FILES =
-
-SRCS = $(C_FILES) $(H_FILES)
-OBJS = $(C_O_FILES) $(S_O_FILES)
-
-PGMS = $(C_FILES:%.c=$(ARCH)/%.rel)
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
-include $(RTEMS_ROOT)/make/leaf.cfg
-
-INSTALL_CHANGE = @INSTALL_CHANGE@
-
-#
-# (OPTIONAL) Add local stuff here using +=
-#
-
-DEFINES +=
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-ASM4FLAGS += -I $(PROJECT_INCLUDE)/rtems
-LD_PATHS +=
-LD_LIBS +=
-LDFLAGS +=
-
-#
-# Add your list of files to delete here.  The config files
-#  already know how to delete some stuff, so you may want
-#  to just run 'make clean' first to see what gets missed.
-#  'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) $(OBJS) $(PGMS)
-	$(INSTALL_VARIANT) -m 755 ${PGMS} $(PROJECT_RELEASE)/lib
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	cd $(top_builddir) \
-	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
Index: c/src/exec/sapi/src/Makefile.am
===================================================================
--- c/src/exec/sapi/src/Makefile.am	(revision fba12eb6ff4a91fcbac1c43dd3196114cc12756b)
+++ c/src/exec/sapi/src/Makefile.am	(revision fba12eb6ff4a91fcbac1c43dd3196114cc12756b)
@@ -0,0 +1,28 @@
+##
+##  $Id$
+##
+
+AUTOMAKE_OPTIONS = foreign 1.4
+
+C_FILES = debug.c entrytable.c extension.c fatal.c exinit.c io.c itronapi.c \
+    posixapi.c rtemsapi.c
+C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
+
+SRCS = $(C_FILES)
+OBJS = $(C_O_FILES)
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../../../automake/lib.am
+
+#
+# Add local stuff here using +=
+#
+
+AM_CPPFLAGS += -D__RTEMS_INSIDE__
+AM_CFLAGS += $(CFLAGS_OS_V)
+
+all: ${ARCH} ${OBJS}
+
+EXTRA_DIST = $(C_FILES)
+
+include $(top_srcdir)/../../../automake/local.am
Index: c/src/exec/sapi/src/Makefile.in
===================================================================
--- c/src/exec/sapi/src/Makefile.in	(revision 9608320702e8dba9947987cd34001824638c434e)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#
-#  $Id$
-#
-
-@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ../..
-subdir = sapi/src
-
-RTEMS_ROOT = @RTEMS_ROOT@
-PROJECT_ROOT = @PROJECT_ROOT@
-
-VPATH = @srcdir@
-
-C_PIECES = debug entrytable extension fatal exinit io \
-    itronapi posixapi rtemsapi
-C_FILES = $(C_PIECES:%=%.c)
-C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
-
-SRCS = $(C_FILES)
-OBJS = $(C_O_FILES)
-
-include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
-include $(RTEMS_ROOT)/make/lib.cfg
-
-INSTALL_CHANGE = @INSTALL_CHANGE@
-
-#
-# Add local stuff here using +=
-#
-
-DEFINES += -D__RTEMS_INSIDE__
-CPPFLAGS +=
-CFLAGS += $(CFLAGS_OS_V)
-
-#
-# Add your list of files to delete here.  The config files
-#  already know how to delete some stuff, so you may want
-#  to just run 'make clean' first to see what gets missed.
-#  'make clobber' already includes 'make clean'
-#
-
-CLEAN_ADDITIONS +=
-CLOBBER_ADDITIONS +=
-
-all: ${ARCH} $(SRCS) ${OBJS}
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	cd $(top_builddir) \
-	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
