Index: c/src/libnetworking/ChangeLog
===================================================================
--- c/src/libnetworking/ChangeLog	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/ChangeLog	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -1,2 +1,15 @@
+2004-01-15	Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+	* Makefile.am: Remove wrapup.
+	* pppd/Makefile.am: Build libpppd.
+	Use automake-compilation rules.
+	* rtems_servers/Makefile.am: Build libftpd.
+	Use automake-compilation rules.
+	* rtems_telnetd/Makefile.am: Build libtelnetd.
+	Use automake-compilation rules.
+	* rtems_webserver/Makefile.am: Build libhttpd.
+	Use automake-compilation rules.
+	* wrapup/Makefile.am: Remove (Unused).
+
 2004-01-14	Ralf Corsepius <corsepiu@faw.uni-ulm.de>
 
Index: c/src/libnetworking/Makefile.am
===================================================================
--- c/src/libnetworking/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,5 +3,5 @@
 ##
 
-SUBDIRS = rtems_servers pppd rtems_telnetd rtems_webserver wrapup
+SUBDIRS = rtems_servers pppd rtems_telnetd rtems_webserver
 
 include $(top_srcdir)/automake/subdirs.am
Index: c/src/libnetworking/pppd/Makefile.am
===================================================================
--- c/src/libnetworking/pppd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/pppd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,35 +3,33 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c ipcp.c lcp.c \
-    magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c rtemsmain.c \
-    rtemspppd.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
+CLEANFILES =
+EXTRA_LIBRARIES =
 
 if HAS_NETWORKING
 include_HEADERS = rtemspppd.h rtemsdialer.h
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libpppd.a
+CLEANFILES += libpppd.a
+libpppd_a_SOURCES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c \
+    ipcp.c lcp.c magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c \
+    rtemsmain.c rtemspppd.c
+libpppd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-all-local: $(PREINSTALL_FILES) $(LIB)
+EXTRA_LIBRARIES += libpppd_g.a
+CLEANFILES += libpppd_g.a
+libpppd_g_a_SOURCES = $(libpppd_a_SOURCES)
+libpppd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libpppd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+# FIXME: Move sources to libpppd_a_SOURCES, remove other files.
+EXTRA_DIST = ccp.h chap.h chap_ms.h fsm.h ipcp.h ipxcp.c ipxcp.h lcp.c lcp.h \
+    magic.h md4.h md5.h patchlevel.h pathnames.h pppd.h upap.h
 
-EXTRA_DIST = auth.c ccp.c ccp.h chap.c chap.h chap_ms.c chap_ms.h chat.c \
-    demand.c fsm.c fsm.h ipcp.c ipcp.h ipxcp.c ipxcp.h lcp.c lcp.h magic.c \
-    magic.h md4.c md4.h md5.c md5.h options.c patchlevel.h pathnames.h \
-    pppd.h rtemsdialer.h rtemsmain.c rtemspppd.c rtemspppd.h sys-rtems.c \
-    upap.c upap.h utils.c
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -52,5 +50,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: c/src/libnetworking/rtems_servers/Makefile.am
===================================================================
--- c/src/libnetworking/rtems_servers/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/rtems_servers/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,33 +3,27 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = ftpd.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
-
-EXTRA_DIST = ftpd.c ftpd.h
+CLEANFILES =
+EXTRA_LIBRARIES =
 
 if HAS_NETWORKING
-include_rtemsdir = $(includedir)/rtems
-
 include_HEADERS = ftpd.h
 
-include_rtems_HEADERS =
+EXTRA_LIBRARIES += libftpd.a
+CLEANFILES += libftpd.a
+libftpd_a_SOURCES = ftpd.c ftpd.h
+libftpd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libftpd_g.a
+CLEANFILES += libftpd_g.a
+libftpd_g_a_SOURCES = $(libftpd_a_SOURCES)
+libftpd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+noinst_DATA = libftpd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -41,9 +35,4 @@
 
 if HAS_NETWORKING
-$(PROJECT_INCLUDE)/rtems/$(dirstamp):
-	@$(mkdir_p) $(PROJECT_INCLUDE)/rtems
-	@: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-
 $(PROJECT_INCLUDE)/ftpd.h: ftpd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ftpd.h
@@ -51,5 +40,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: c/src/libnetworking/rtems_telnetd/Makefile.am
===================================================================
--- c/src/libnetworking/rtems_telnetd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/rtems_telnetd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,16 +3,9 @@
 ##
 
-LIBNAME = libtelnetd-tmp
-LIB = $(ARCH)/$(LIBNAME).a
-
-C_FILES = pty.c telnetd.c icmds.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# (OPTIONAL) Add local stuff here using +=
-#
+EXTRA_LIBRARIES =
+CLEANFILES =
 
 if HAS_NETWORKING
@@ -20,13 +13,20 @@
 include_rtems_HEADERS = pty.h telnetd.h
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libtelnetd.a
+CLEANFILES += libtelnetd.a
+libtelnetd_a_SOURCES = pty.c pty.h telnetd.c telnetd.h icmds.c
+libtelnetd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+EXTRA_LIBRARIES += libtelnetd_g.a
+CLEANFILES += libtelnetd_g.a
+libtelnetd_g_a_SOURCES = $(libtelnetd_a_SOURCES)
+libtelnetd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libtelnetd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+EXTRA_DIST = README
 
-EXTRA_DIST = README pty.c telnetd.c pty.h icmds.c telnetd.h
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -47,5 +47,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: c/src/libnetworking/rtems_webserver/Makefile.am
===================================================================
--- c/src/libnetworking/rtems_webserver/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ c/src/libnetworking/rtems_webserver/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,24 +3,11 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = asp.c balloc.c default.c ejlex.c ejparse.c emfdb.c form.c h.c \
-    handler.c md5c.c mime.c misc.c webpage.c ringq.c rom.c security.c sock.c \
-    socket.c sym.c uemf.c um.c url.c value.c wbase64.c webrom.c webs.c \
-    websuemf.c webmain.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
+EXTRA_LIBRARIES =
+CLEANFILES =
 
 AM_CPPFLAGS += -DWEBS -DUEMF -DOS="RTEMS"
-
-$(LIB): $(OBJS)
-	$(make-library)
 
 if HAS_NETWORKING
@@ -32,15 +19,24 @@
     wsIntrn.h
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+EXTRA_LIBRARIES += libhttpd.a
+CLEANFILES += libhttpd.a
+libhttpd_a_SOURCES = asp.c balloc.c default.c ejlex.c ejparse.c emfdb.c \
+    form.c h.c handler.c md5c.c mime.c misc.c webpage.c ringq.c rom.c \
+    security.c sock.c socket.c sym.c uemf.c um.c url.c value.c wbase64.c \
+    webrom.c webs.c websuemf.c webmain.c
+libhttpd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
+
+EXTRA_LIBRARIES += libhttpd_g.a
+CLEANFILES += libhttpd_g.a
+libhttpd_g_a_SOURCES = $(libhttpd_a_SOURCES)
+libhttpd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libhttpd$(LIB_VARIANT).a
 endif
 endif
 
-.PRECIOUS: $(LIB)
+all-local: $(PREINSTALL_FILES)
 
-EXTRA_DIST = asp.c balloc.c default.c ej.h ejlex.c ejparse.c form.c h.c \
-    handler.c mime.c misc.c ringq.c rom.c rtems_webserver.h security.c \
-    sock.c socket.c sym.c uemf.c uemf.h um.h url.c value.c wbase64.c \
-    webcomp.c webmain.c webpage.c webrom.c webs.c webs.h websuemf.c \
-    wsIntrn.h
+EXTRA_DIST = webcomp.c webpage.c
 
 PREINSTALL_FILES =
@@ -96,5 +92,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: src/libnetworking/wrapup/.cvsignore
===================================================================
--- c/src/libnetworking/wrapup/.cvsignore	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ 	(revision )
@@ -1,2 +1,0 @@
-Makefile
-Makefile.in
Index: src/libnetworking/wrapup/Makefile.am
===================================================================
--- c/src/libnetworking/wrapup/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ 	(revision )
@@ -1,23 +1,0 @@
-##
-## $Id$
-##
-
-if HAS_POSIX
-POSIX_PIECES = rtems_webserver
-endif
-
-NET_O_PIECES = rtems_servers rtems_telnetd pppd $(POSIX_PIECES)
-OBJS = $(foreach piece, $(NET_O_PIECES), ../$(piece)/$(ARCH)/*.$(OBJEXT))
-LIB = $(ARCH)/libnetapps.a
-
-include $(top_srcdir)/automake/compile.am
-include $(top_srcdir)/automake/lib.am
-
-if HAS_NETWORKING
-$(LIB): $(OBJS)
-	$(make-library)
-
-all-local: $(OBJS) $(LIB)
-endif
-
-include $(top_srcdir)/automake/local.am
Index: cpukit/ftpd/Makefile.am
===================================================================
--- cpukit/ftpd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ cpukit/ftpd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,33 +3,27 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = ftpd.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
-
-EXTRA_DIST = ftpd.c ftpd.h
+CLEANFILES =
+EXTRA_LIBRARIES =
 
 if HAS_NETWORKING
-include_rtemsdir = $(includedir)/rtems
-
 include_HEADERS = ftpd.h
 
-include_rtems_HEADERS =
+EXTRA_LIBRARIES += libftpd.a
+CLEANFILES += libftpd.a
+libftpd_a_SOURCES = ftpd.c ftpd.h
+libftpd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libftpd_g.a
+CLEANFILES += libftpd_g.a
+libftpd_g_a_SOURCES = $(libftpd_a_SOURCES)
+libftpd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+noinst_DATA = libftpd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -41,9 +35,4 @@
 
 if HAS_NETWORKING
-$(PROJECT_INCLUDE)/rtems/$(dirstamp):
-	@$(mkdir_p) $(PROJECT_INCLUDE)/rtems
-	@: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-
 $(PROJECT_INCLUDE)/ftpd.h: ftpd.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ftpd.h
@@ -51,5 +40,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: cpukit/httpd/Makefile.am
===================================================================
--- cpukit/httpd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ cpukit/httpd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,24 +3,11 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = asp.c balloc.c default.c ejlex.c ejparse.c emfdb.c form.c h.c \
-    handler.c md5c.c mime.c misc.c webpage.c ringq.c rom.c security.c sock.c \
-    socket.c sym.c uemf.c um.c url.c value.c wbase64.c webrom.c webs.c \
-    websuemf.c webmain.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
+EXTRA_LIBRARIES =
+CLEANFILES =
 
 AM_CPPFLAGS += -DWEBS -DUEMF -DOS="RTEMS"
-
-$(LIB): $(OBJS)
-	$(make-library)
 
 if HAS_NETWORKING
@@ -32,15 +19,24 @@
     wsIntrn.h
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+EXTRA_LIBRARIES += libhttpd.a
+CLEANFILES += libhttpd.a
+libhttpd_a_SOURCES = asp.c balloc.c default.c ejlex.c ejparse.c emfdb.c \
+    form.c h.c handler.c md5c.c mime.c misc.c webpage.c ringq.c rom.c \
+    security.c sock.c socket.c sym.c uemf.c um.c url.c value.c wbase64.c \
+    webrom.c webs.c websuemf.c webmain.c
+libhttpd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
+
+EXTRA_LIBRARIES += libhttpd_g.a
+CLEANFILES += libhttpd_g.a
+libhttpd_g_a_SOURCES = $(libhttpd_a_SOURCES)
+libhttpd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libhttpd$(LIB_VARIANT).a
 endif
 endif
 
-.PRECIOUS: $(LIB)
+all-local: $(PREINSTALL_FILES)
 
-EXTRA_DIST = asp.c balloc.c default.c ej.h ejlex.c ejparse.c form.c h.c \
-    handler.c mime.c misc.c ringq.c rom.c rtems_webserver.h security.c \
-    sock.c socket.c sym.c uemf.c uemf.h um.h url.c value.c wbase64.c \
-    webcomp.c webmain.c webpage.c webrom.c webs.c webs.h websuemf.c \
-    wsIntrn.h
+EXTRA_DIST = webcomp.c webpage.c
 
 PREINSTALL_FILES =
@@ -96,5 +92,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: cpukit/pppd/Makefile.am
===================================================================
--- cpukit/pppd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ cpukit/pppd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,35 +3,33 @@
 ##
 
-LIBNAME = lib.a
-LIB = $(ARCH)/$(LIBNAME)
-
-C_FILES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c ipcp.c lcp.c \
-    magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c rtemsmain.c \
-    rtemspppd.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# Add local stuff here using +=
-#
+CLEANFILES =
+EXTRA_LIBRARIES =
 
 if HAS_NETWORKING
 include_HEADERS = rtemspppd.h rtemsdialer.h
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libpppd.a
+CLEANFILES += libpppd.a
+libpppd_a_SOURCES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c \
+    ipcp.c lcp.c magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c \
+    rtemsmain.c rtemspppd.c
+libpppd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-all-local: $(PREINSTALL_FILES) $(LIB)
+EXTRA_LIBRARIES += libpppd_g.a
+CLEANFILES += libpppd_g.a
+libpppd_g_a_SOURCES = $(libpppd_a_SOURCES)
+libpppd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libpppd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+# FIXME: Move sources to libpppd_a_SOURCES, remove other files.
+EXTRA_DIST = ccp.h chap.h chap_ms.h fsm.h ipcp.h ipxcp.c ipxcp.h lcp.c lcp.h \
+    magic.h md4.h md5.h patchlevel.h pathnames.h pppd.h upap.h
 
-EXTRA_DIST = auth.c ccp.c ccp.h chap.c chap.h chap_ms.c chap_ms.h chat.c \
-    demand.c fsm.c fsm.h ipcp.c ipcp.h ipxcp.c ipxcp.h lcp.c lcp.h magic.c \
-    magic.h md4.c md4.h md5.c md5.h options.c patchlevel.h pathnames.h \
-    pppd.h rtemsdialer.h rtemsmain.c rtemspppd.c rtemspppd.h sys-rtems.c \
-    upap.c upap.h utils.c
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -52,5 +50,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
Index: cpukit/telnetd/Makefile.am
===================================================================
--- cpukit/telnetd/Makefile.am	(revision 033f068631947320bcc845354b9552276d7b80d2)
+++ cpukit/telnetd/Makefile.am	(revision 633456e9200c909c9aad6ab7fae50b70b829999d)
@@ -3,16 +3,9 @@
 ##
 
-LIBNAME = libtelnetd-tmp
-LIB = $(ARCH)/$(LIBNAME).a
-
-C_FILES = pty.c telnetd.c icmds.c
-OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
-
 include $(top_srcdir)/automake/compile.am
 include $(top_srcdir)/automake/lib.am
 
-#
-# (OPTIONAL) Add local stuff here using +=
-#
+EXTRA_LIBRARIES =
+CLEANFILES =
 
 if HAS_NETWORKING
@@ -20,13 +13,20 @@
 include_rtems_HEADERS = pty.h telnetd.h
 
-$(LIB): $(OBJS)
-	$(make-library)
+EXTRA_LIBRARIES += libtelnetd.a
+CLEANFILES += libtelnetd.a
+libtelnetd_a_SOURCES = pty.c pty.h telnetd.c telnetd.h icmds.c
+libtelnetd_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
 
-all-local: $(PREINSTALL_FILES) $(OBJS) $(LIB)
+EXTRA_LIBRARIES += libtelnetd_g.a
+CLEANFILES += libtelnetd_g.a
+libtelnetd_g_a_SOURCES = $(libtelnetd_a_SOURCES)
+libtelnetd_g_a_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_DEBUG_V)
+
+noinst_DATA = libtelnetd$(LIB_VARIANT).a
 endif
 
-.PRECIOUS: $(LIB)
+EXTRA_DIST = README
 
-EXTRA_DIST = README pty.c telnetd.c pty.h icmds.c telnetd.h
+all-local: $(PREINSTALL_FILES)
 
 PREINSTALL_FILES =
@@ -47,5 +47,5 @@
 endif
 
-CLEANFILES = $(PREINSTALL_FILES)
+CLEANFILES += $(PREINSTALL_FILES)
 
 include $(top_srcdir)/automake/local.am
