2008-09-29  Robert Riebisch <rr@bttr-software.de>

	* dos/gccdos.mak: Updated to reflect PDCurses version 3.4
	changes.
	manual target added to produce PDCurses.txt.


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.4-orig/dos/gccdos.mak PDCurses-3.4/dos/gccdos.mak
--- PDCurses-3.4-orig/dos/gccdos.mak	2008-07-21 14:20:30 +0200
+++ PDCurses-3.4/dos/gccdos.mak	2008-10-07 23:33:10 +0200
@@ -1,11 +1,19 @@
 # GNU MAKE (3.79.1) Makefile for PDCurses library - DOS DJGPP V2.0+
 #
 # Usage: make -f [path\]gccdos.mak [DEBUG=Y] [target]
 #
 # where target can be any of:
-# [all|libs|demos|dist|pdcurses.a|testcurs.exe...]
+# [all|libs|demos|manual|dist|install|libpdcurses.a|testcurs.exe...]
+#
+# Target `install' 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
 
 O = o
 
 ifndef PDCURSES_SRCDIR
 	PDCURSES_SRCDIR = ..
@@ -16,10 +24,16 @@ include $(PDCURSES_SRCDIR)/libobjs.mif
 
 osdir		= $(PDCURSES_SRCDIR)/dos
 
 PDCURSES_DOS_H	= $(osdir)/pdcdos.h
 
+prefix		= /dev/env/DJDIR
+includedir	= $(prefix)/include
+libdir		= $(prefix)/lib
+docdir		= $(prefix)/contrib/PDCurses.$(VER)
+gnudocsdir	= $(prefix)/gnudocs/PDCurses.$(VER)
+
 CC		= gcc
 
 ifeq ($(DEBUG),Y)
 	CFLAGS  = -g -Wall -DPDCDEBUG
 	LDFLAGS = -g
@@ -33,29 +47,53 @@ CFLAGS += -I$(PDCURSES_SRCDIR)
 LINK		= gcc
 
 LIBEXE		= ar
 LIBFLAGS	= rcv
 
-LIBCURSES	= pdcurses.a
+LIBCURSES	= libpdcurses.a
+LIBPANEL	= libpanel.a
+
+CP		= /dev/env/DJDIR/bin/cp
+RM		= /dev/env/DJDIR/bin/rm
+STRIP		= /dev/env/DJDIR/bin/strip
+INSTALL		= /dev/env/DJDIR/bin/ginstall
 
-.PHONY: all libs clean demos dist
+.PHONY: all libs clean demos dist install
 
-all:	libs demos
+all:	libs demos manual
 
 libs:	$(LIBCURSES)
 
 clean:
-	-del *.o
-	-del *.a
-	-del *.exe
+	-$(RM) *.o
+	-$(RM) *.a
+	-$(RM) *.exe
 
 demos:	$(DEMOS)
-	strip *.exe
+	$(STRIP) *.exe
+
+manual:
+	$(MAKE) -C $(PDCURSES_SRCDIR)/doc $@
+
+install: $(LIBCURSES) manual
+	$(INSTALL) -d $(includedir)
+	$(INSTALL) -d $(libdir)
+	$(INSTALL) -d $(docdir)
+	$(INSTALL) -d $(gnudocsdir)
+	$(INSTALL) $(PDCURSES_SRCDIR)/curses.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)/doc/PDCurses.txt $(gnudocsdir)
 
 $(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)
