2007-08-13  Juan Manuel Guerrero <juan.guerrero@gmx.de>

	* dos/gccdos.mak: New variables prefix, includedir, libdir
	docdir and mandir added to make it possible to install in
	standard places.
	library names changed to libpdcurses.a and libpanel.a.
	install target added to install the products in the right
	places of a standard DJGPP installation directory tree.





diff -aprNU5 PDCurses-3.3.orig/dos/gccdos.mak PDCurses-3.3/dos/gccdos.mak
--- PDCurses-3.3.orig/dos/gccdos.mak	2007-06-17 03:23:24 +0000
+++ PDCurses-3.3/dos/gccdos.mak	2007-08-13 02:48:54 +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|testcurs.exe...]
+# [all|libs|demos|dist|install|pdcurses.a|testcurs.exe...]
 #
 #########################################################################
 
 O = o
 
@@ -37,14 +37,36 @@ CFLAGS += -I$(PDCURSES_SRCDIR)
 LINK		= gcc
 
 LIBEXE		= ar
 LIBFLAGS	= rcv
 
-LIBCURSES	= pdcurses.a
+LIBCURSES	= libpdcurses.a
+LIBPANEL	= libpanel.a
 
 #########################################################################
-.PHONY: all libs clean demos dist
+# 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)/doc
+
+
+RM		= /dev/env/DJDIR/bin/rm
+INSTALL		= /dev/env/DJDIR/bin/ginstall
+#########################################################################
+.PHONY: all libs clean demos dist install
 
 all:	libs demos
 
 libs:	$(LIBCURSES)
 
@@ -54,15 +76,34 @@ clean:
 	-del *.exe
 
 demos:	$(DEMOS)
 	strip *.exe
 
+install: $(LIBCURSES)
+	$(INSTALL) -d $(includedir)
+	$(INSTALL) -d $(libdir)
+	$(INSTALL) -d $(docdir)
+	$(INSTALL) -d $(mandir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/curses.h $(includedir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/curspriv.h $(includedir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/panel.h $(includedir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/term.h $(includedir)
+	$(INSTALL) $(LIBCURSES) $(libdir)
+	$(INSTALL) $(LIBPANEL) $(libdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/README $(docdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/HISTORY $(docdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/IMPLEMNT $(docdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/maintain.er $(docdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/doc/intro.txt $(mandir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/doc/sdl.txt $(mandir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/doc/x11.txt $(mandir)
+
 #------------------------------------------------------------------------
 
 $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
 	$(LIBEXE) $(LIBFLAGS) $@ $?
-	-copy $(LIBCURSES) panel.a
+	-cp $(LIBCURSES) $(LIBPANEL)
 
 $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
 $(PDCOBJS) : $(PDCURSES_DOS_H)
 $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
 panel.o : $(PANEL_HEADER)
