From e8223fcd40f3754faf59875512431dbb965907d6 Mon Sep 17 00:00:00 2001
From: James Troup <james@nocrew.org>
Date: Fri, 2 Mar 2001 02:34:29 +0000
Subject: [PATCH] Proper Makefile. [doogie]

---
 Makefile | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 2fd1dd28..816908d8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,25 @@
-sql-aptvc.so: sql-aptvc.cpp
-	gcc -Wall -I/usr/include/postgresql/ sql-aptvc.cpp -fPIC -shared -lapt-pkg -o sql-aptvc.so
+#!/usr/bin/make -f
+
+CXXFLAGS	= -I/usr/include/postgresql/ -fPIC -Wall
+CFLAGS		= -fPIC -Wall
+LDFLAGS		= -fPIC
+LIBS		= -lapt-pkg
+
+LD		= ld
+CC		= gcc
+C++		= g++
+CPP		= cpp
+
+SUBDIRS		= docs
+
+all: sql-aptvc.so $(patsubst %,%.make,$(SUBDIRS))
+
+%.make:
+	$(MAKE) -C $* $(MAKECMDGOALS)
+
+sql-aptvc.o: sql-aptvc.cpp
+sql-aptvc.so: sql-aptvc.o
+	$(LD) $(LDFLAGS) $(LIBS) -shared -o $@ $<
+clean: $(patsubst %,%.make,$(SUBDIRS))
+	rm -f sql-aptvc.so sql-aptvc.o
 
-clean: 
-	rm -f sql-aptvc.so
-- 
2.39.5