--- Makefile.old	Tue Jan  4 13:54:58 2000
+++ Makefile	Mon May 19 17:01:10 2003
@@ -3,46 +3,56 @@
 # Compile-time program options
 #OPTS	= -DCAPITALIZE -DALTPHON -DNUMERALS -DRAND48 -DDEBIAN
 # or, if you want any of the first three rolled into one (plus -s), use this:
-OPTS	= -DALLBYOPTS -DRAND48 -DDEBIAN
+OPTS	= -DALLBYOPTS -DCAPITALIZE -DALTPHON -DNUMERALS -DRAND48
 
 # Standard items
 CC	= gcc
 CFLAGS	= -O3
 LD	= cc
-#LDFLAGS	= -g
-LIBS	= -lm
+
+prefix := /usr/local
+
+LIBS	= -lgnugetopt
+
+LIBDIR  = $(prefix)/lib
+INCLUDEDIR = $(prefix)/include
+
+LDFLAGS = '-L$(LIBDIR)'
+CPPFLAGS ='-I$(INCLUDEDIR)'
+
 INSTALL	= install -s
 INFLAGS	=
 
 # Where to install
-DESTDIR	= /usr/local/bin
-MANDIR	= /usr/local/man/man1
+DESTDIR := 
+BINDIR	= $(prefix)/bin
+MANDIR	= $(prefix)/man/man1
 
 # End configuration section
 
-#all: pwgen spwgen
-all: pwgen
+all: pwgen spwgen
+#all: pwgen
 
 test: pwgen
 	./pwgen 8 20
 
 install: all
-	$(INSTALL) pwgen $(DESTDIR)
-	install pwgen.1 $(MANDIR)
-	chmod 555 $(DESTDIR)/pwgen
-	chmod 444 $(MANDIR)/pwgen.1
+	$(INSTALL) pwgen $(DESTDIR)$(BINDIR)
+	install pwgen.1 $(DESTDIR)$(MANDIR)
+	chmod 555 $(DESTDIR)$(BINDIR)/pwgen
+	chmod 444 $(DESTDIR)$(MANDIR)/pwgen.1
 
 spwgen:	spwgen.o
 	$(LD) $(LDFLAGS) -o spwgen spwgen.o $(LIBS)
 
 spwgen.o: spwgen.c
-	$(CC) $(CFLAGS) $(OPTS) -c -o spwgen.o spwgen.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTS) -c -o spwgen.o spwgen.c
 
 pwgen:	pwgen.o
 	$(LD) $(LDFLAGS) -o pwgen pwgen.o $(LIBS)
 
 pwgen.o: pwgen.c
-	$(CC) $(CFLAGS) $(OPTS) -c -o pwgen.o pwgen.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTS) -c -o pwgen.o pwgen.c
 
 clean:
 	rm -f core a.out pwgen spwgen *.o *.old *~
