-# Source code for the contributed non-core things
-SOURCE = contrib/extracttar.cc contrib/arfile.cc
-
-# Source code for the main library
-SOURCE+= filelist.cc database.cc dirstream.cc extract.cc \
- deb/dpkgdb.cc deb/debfile.cc
-
-# Public header files
-HEADERS = extracttar.h arfile.h filelist.h database.h extract.h \
- dpkgdb.h dirstream.h debfile.h
+SOURCE = $(sort $(wildcard *.cc */*.cc))
+HEADERS = $(addprefix apt-pkg/,$(notdir $(sort $(wildcard *.h */*.h))))