Index: cpukit/sapi/ChangeLog
===================================================================
--- cpukit/sapi/ChangeLog	(revision 51f97de6cacb9ef65ec7cfd8a5e17dbdf620325c)
+++ cpukit/sapi/ChangeLog	(revision 8b273c20dbdbf0e5b2fa995028ce49429d71d9eb)
@@ -1,2 +1,6 @@
+2003-11-23	Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+	* Makefile.am: Reworked.
+
 2003-09-04	Joel Sherrill <joel@OARcorp.com>
 
Index: cpukit/sapi/Makefile.am
===================================================================
--- cpukit/sapi/Makefile.am	(revision 51f97de6cacb9ef65ec7cfd8a5e17dbdf620325c)
+++ cpukit/sapi/Makefile.am	(revision 8b273c20dbdbf0e5b2fa995028ce49429d71d9eb)
@@ -7,48 +7,22 @@
 include $(top_srcdir)/automake/lib.am
 
-$(PROJECT_INCLUDE):
-	@$(mkinstalldirs) $@
-$(PROJECT_INCLUDE)/rtems:
-	@$(mkinstalldirs) $@
-
-$(PROJECT_INCLUDE)/%.h: include/%.h
-	$(INSTALL_DATA) $< $@
-$(PROJECT_INCLUDE)/%.inl: $(INLINEdir)/%.inl
-	$(INSTALL_DATA) $< $@
-
 include_HEADERS = include/confdefs.h
 
-PREINSTALL_FILES = $(PROJECT_INCLUDE)
-PREINSTALL_FILES += $(include_HEADERS:include/%=$(PROJECT_INCLUDE)/%)
-
 include_rtemsdir = $(includedir)/rtems
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems
 
 include_rtems_HEADERS = include/rtems/config.h include/rtems/extension.h \
-    include/rtems/fatal.h \
-    include/rtems/init.h include/rtems/io.h include/rtems/mptables.h \
-    include/rtems/sptables.h
-
-PREINSTALL_FILES += $(include_rtems_HEADERS:include/%=$(PROJECT_INCLUDE)/%)
+    include/rtems/fatal.h include/rtems/init.h include/rtems/io.h \
+    include/rtems/mptables.h include/rtems/sptables.h
 
 EXTRA_DIST = include/rtems/README
 
 ## inline
-
-inline_H_FILES = inline/rtems/extension.inl
-noinst_HEADERS = $(inline_H_FILES)
-
 if INLINE
-PREINSTALL_FILES += $(inline_H_FILES:inline/%=$(PROJECT_INCLUDE)/%)
-include_rtems_HEADERS += $(inline_H_FILES)
+include_rtems_HEADERS += inline/rtems/extension.inl
 endif
 
 ## macros
-macros_H_FILES = macros/rtems/extension.inl
-noinst_HEADERS += $(macros_H_FILES)
-
 if MACROS
-PREINSTALL_FILES += $(macros_H_FILES:macros/%=$(PROJECT_INCLUDE)/%)
-include_rtems_HEADERS += $(macros_H_FILES)
+include_rtems_HEADERS += macros/rtems/extension.inl
 endif
 
@@ -57,6 +31,6 @@
 LIB=$(ARCH)/libsapi.a
 
-EXTENSION_FILES = src/extension.c src/extensioncreate.c src/extensiondelete.c \
-    src/extensionident.c
+EXTENSION_FILES = src/extension.c src/extensioncreate.c \
+    src/extensiondelete.c src/extensionident.c
 C_FILES = src/debug.c $(EXTENSION_FILES) src/fatal.c src/exinit.c src/io.c \
     src/itronapi.c src/posixapi.c src/rtemsapi.c
@@ -79,3 +53,53 @@
 EXTRA_DIST += $(C_FILES)
 
+PREINSTALL_FILES =
+
+$(PROJECT_INCLUDE)/confdefs.h: include/confdefs.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/confdefs.h
+
+$(PROJECT_INCLUDE)/rtems:
+	@$(mkinstalldirs) $(PROJECT_INCLUDE)/rtems
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems
+
+$(PROJECT_INCLUDE)/rtems/config.h: include/rtems/config.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/config.h
+
+$(PROJECT_INCLUDE)/rtems/extension.h: include/rtems/extension.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extension.h
+
+$(PROJECT_INCLUDE)/rtems/fatal.h: include/rtems/fatal.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/fatal.h
+
+$(PROJECT_INCLUDE)/rtems/init.h: include/rtems/init.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/init.h
+
+$(PROJECT_INCLUDE)/rtems/io.h: include/rtems/io.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/io.h
+
+$(PROJECT_INCLUDE)/rtems/mptables.h: include/rtems/mptables.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/mptables.h
+
+$(PROJECT_INCLUDE)/rtems/sptables.h: include/rtems/sptables.h
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/sptables.h
+
+if INLINE
+$(PROJECT_INCLUDE)/rtems/extension.inl: inline/rtems/extension.inl
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extension.inl
+endif
+
+if MACROS
+$(PROJECT_INCLUDE)/rtems/extension.inl: macros/rtems/extension.inl
+	$(INSTALL_DATA) $< $@
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extension.inl
+endif
+
 include $(top_srcdir)/automake/local.am
