Makefile.in 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. VPATH = @srcdir@
  2. srcdir = @srcdir@
  3. top_srcdir = @top_srcdir@
  4. top_builddir = ..
  5. include ../Makefile.conf
  6. SOURCES = main.c enquiry.c filesdb.c archives.c processarc.c \
  7. cleanup.c select.c packages.c configure.c remove.c \
  8. help.c depcon.c errors.c update.c
  9. MAN8PAGES = dpkg.8
  10. OBJECTS = $(patsubst %.c, %.o, $(SOURCES))
  11. GENFILES = $(OBJECTS) archtable.h dpkg dpkg-static
  12. .PHONY: all
  13. all:: dpkg
  14. ifdef ALSO_STATIC
  15. all:: dpkg-static
  16. endif
  17. .PHONY: install
  18. install:: all
  19. .PHONY: clean
  20. clean::
  21. $(RM) $(GENFILES)
  22. .PHONY: distclean
  23. cvslean:: clean
  24. $(RM) Makefile
  25. .PHONY: install
  26. install:: install-program install-doc
  27. .PHONY: install-program
  28. install-program:
  29. $(mkinstalldirs) $(DESTDIR)/$(bindir)
  30. $(INSTALL_PROGRAM) dpkg $(DESTDIR)/$(bindir)
  31. ifdef ALSO_STATIC
  32. $(INSTALL_PROGRAM) dpkg-static $(DESTDIR)/$(bindir)
  33. endif
  34. $(mkinstalldirs) $(DESTDIR)/$(admindir)/alternatives
  35. $(mkinstalldirs) $(DESTDIR)/$(admindir)/info
  36. $(mkinstalldirs) $(DESTDIR)/$(admindir)/updates
  37. .PHONY: install-doc
  38. install-doc:
  39. $(mkinstalldirs) $(DESTDIR)/$(man8dir)
  40. set -e ; for i in $(MAN8PAGES) ; do \
  41. if test -f $$i ; then d= ; else d="$(srcdir)/" ; fi ; \
  42. $(INSTALL_DATA) $$d$$i $(DESTDIR)/$(man8dir) ; \
  43. done
  44. dpkg-static: LDFLAGS += -static
  45. dpkg dpkg-static: $(OBJECTS) ../lib/libdpkg.a
  46. $(CC) $(LDFLAGS) -L../lib -o $@ $(OBJECTS) $(LIBS) $(NLS_LIBS) -ldpkg
  47. enquiry.o: archtable.h
  48. archtable.h: $(top_srcdir)/archtable
  49. expand $< | \
  50. perl -ne 'print " { \"$$1\",$$2\"$$3\",$$4\"$$5\" },\n" \
  51. if m/^(?!\s*#)\s*(\S+)(\s+)(\S+)(\s+)(\S+)\s*$$/' \
  52. >$@