2007-04-05  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* dos/gccdos.mak: Adapt makefile to work with stock DJGPP installation.



diff -aprNU5 PDCurses-3.0.orig/dos/gccdos.mak PDCurses-3.0/dos/gccdos.mak
--- PDCurses-3.0.orig/dos/gccdos.mak	2006-12-29 18:35:52 +0000
+++ PDCurses-3.0/dos/gccdos.mak	2007-04-05 23:44:26 +0000
@@ -3,11 +3,11 @@
 # GNU MAKE (3.79.1) Makefile for PDCurses library - DOS DJGPP V2.0+
 #
 # Usage: make -f [path\]gccdos.mak [-DDEBUG] [target]
 #
 # where target can be any of:
-# [all|libs|demos|dist|pdcurses.a|panel.a|testcurs.exe...]
+# [all|libs|demos|dist|install|pdcurses.a|panel.a|testcurs.exe...]
 #
 ################################################################################
 #
 # First, set the environment variable PDCURSES_SRCDIR, or edit the line 
 # below; for example, "set PDCURSES_SRCDIR=c:\pdcurses".
@@ -15,10 +15,30 @@
 ################################################################################
 PDCURSES_HOME	= $(PDCURSES_SRCDIR)
 ################################################################################
 # Nothing below here should require changing.
 ################################################################################
+# This reproduces the standard installation directory tree of a
+# stock DJGPP distribution.
+#
+# It will install the products in the standard places for a stock
+# DJGPP installation given by the value of the environment variable
+# DJDIR.
+# If the user prefers to install in some other directory, he must
+# supply a new value for the variable prefix at the command line
+# like this:
+#   make -f [path\]gccdos.mak install prefix=/some/other/dir
+################################################################################
+prefix		= /dev/env/DJDIR
+includedir	= $(prefix)/include
+libdir		= $(prefix)/lib
+docdir		= $(prefix)/contrib/pdcurses.$(VER)
+mandir		= $(prefix)/contrib/pdcurses.$(VER)/man
+
+
+RM		= /dev/env/DJDIR/bin/rm
+INSTALL		= /dev/env/DJDIR/bin/ginstall
 
 O = o
 
 include $(PDCURSES_HOME)/version.mif
 include $(PDCURSES_HOME)/libobjs.mif
@@ -44,17 +64,17 @@ CCFLAGS		= $(CFLAGS) $(CPPFLAGS)
 LINK		= gcc
 
 LIBEXE		= ar
 LIBFLAGS	= rcv
 
-LIBCURSES	= pdcurses.a
-LIBPANEL	= panel.a
+LIBCURSES	= libpdcurses.a
+LIBPANEL	= libpanel.a
 
 PDCLIBS		= $(LIBCURSES) $(LIBPANEL)
 
 ################################################################################
-.PHONY: all libs clean demos dist
+.PHONY: all libs clean demos dist install
 
 all:	libs demos
 
 libs:	$(PDCLIBS)
 
@@ -108,10 +128,31 @@ tui.o: $(demodir)/tui.c $(demodir)/tui.h
 tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H)
 	$(CC) -c $(CCFLAGS) -I$(demodir) -o$@ $<
 
 #------------------------------------------------------------------------
 
+install: $(PDCLIBS)
+	$(INSTALL) -d $(includedir)
+	$(INSTALL) -d $(libdir)
+	$(INSTALL) -d $(docdir)
+	$(INSTALL) -d $(mandir)
+	$(INSTALL) $(PDCURSES_HOME)\curses.h $(includedir)
+	$(INSTALL) $(PDCURSES_HOME)\curspriv.h $(includedir)
+	$(INSTALL) $(PDCURSES_HOME)\panel.h $(includedir)
+	$(INSTALL) $(PDCURSES_HOME)\term.h $(includedir)
+	$(INSTALL) $(LIBCURSES) $(libdir)
+	$(INSTALL) $(LIBPANEL) $(libdir)
+	$(INSTALL) $(PDCURSES_HOME)\README $(docdir)
+	$(INSTALL) $(PDCURSES_HOME)\HISTORY $(docdir)
+	$(INSTALL) $(PDCURSES_HOME)\maintain.er $(docdir)
+	$(INSTALL) $(PDCURSES_HOME)\doc\intro.man $(mandir)
+	$(INSTALL) $(PDCURSES_HOME)\doc\latin-1.man $(mandir)
+	$(INSTALL) $(PDCURSES_HOME)\doc\overview.man $(mandir)
+	$(INSTALL) $(PDCURSES_HOME)\doc\x11.man $(mandir)
+
+#------------------------------------------------------------------------
+
 PLATFORM1 = DJGPP 2.03
 PLATFORM2 = DJGPP 2.03 for DOS
 ARCNAME = pdc$(VER)djg
 
 include $(PDCURSES_HOME)/makedist.mif
