Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. srcdir = .
  2. top_srcdir = ..
  3. top_builddir = ..
  4. default: all
  5. include ../Makefile.conf
  6. SOURCES = build.c extract.c info.c main.c
  7. OBJECTS = $(patsubst %.c, %.o, $(SOURCES))
  8. GENFILES = $(OBJECTS) dpkg-deb dpkg-deb-static
  9. .PHONY: all
  10. all:: dpkg-deb
  11. ifdef ALSO_STATIC
  12. all:: dpkg-deb-static
  13. endif
  14. .PHONY: install
  15. install:: all
  16. .PHONY: clean
  17. clean::
  18. -$(RM) $(GENFILES)
  19. .PHONY: distclean
  20. cvslean:: clean
  21. $(RM) Makefile
  22. .PHONY: install
  23. install:: install-program install-doc
  24. .PHONY: install-program
  25. install-program:
  26. $(mkinstalldirs) $(DESTDIR)$(bindir)
  27. $(INSTALL) dpkg-deb $(DESTDIR)$(bindir)
  28. ifdef ALSO_STATIC
  29. $(INSTALL) dpkg-deb-static $(DESTDIR)$(bindir)
  30. endif
  31. .PHONY: install-doc
  32. install-doc:
  33. $(mkinstalldirs) $(DESTDIR)$(man1dir)
  34. $(INSTALL_DATA) $(srcdir)/dpkg-deb.1 $(DESTDIR)$(man1dir)
  35. dpkg-deb-static: LDFLAGS += -static
  36. dpkg-deb-static: ZLIB_LIBS = $(ZLIB_LIBS_ALSO_STATIC)
  37. dpkg-deb-static: BZ2LIB_LIBS = $(BZ2LIB_LIBS_ALSO_STATIC)
  38. dpkg-deb dpkg-deb-static: $(OBJECTS) ../lib/libdpkg.a
  39. $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) $(NLS_LIBS)