--- Makefile.orig 2021-03-08 07:56:18 UTC +++ Makefile @@ -1,23 +1,20 @@ -ifneq ($(srcdir),) -VPATH = $(srcdir) -else -srcdir=$(shell pwd) -endif -CFLAGS = -O2 -g -DWZ_VERSION := $(shell cat $(srcdir)/VERSION) -override CFLAGS += -Wall -W -D_FILE_OFFSET_BITS=64 \ - -DDWZ_VERSION='"$(DWZ_VERSION)"' $(shell cat $(srcdir)/COPYRIGHT_YEARS) -prefix = /usr +srcdir = . +CFLAGS ?= -O2 -g +DWZ_VERSION != cat $(srcdir)/VERSION +CFLAGS += -DDWZ_VERSION='"$(DWZ_VERSION)"' +CYEARS != cat $(srcdir)/COPYRIGHT_YEARS +CFLAGS += $(CYEARS) +prefix = /usr/local exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datarootdir = $(prefix)/share -mandir = $(datarootdir)/man -OBJECTS = dwz.o hashtab.o sha1.o dwarfnames.o +mandir = $(prefix)/share/man +OBJECTS = dwz.o hashtab.o sha1.o dwarfnames.o obstack.o dwz: $(OBJECTS) - $(CC) $(LDFLAGS) -o $@ $^ -lelf + $(CC) $(LDFLAGS) -o $@ $(OBJECTS) -lelf install: dwz - install -D dwz $(DESTDIR)$(bindir)/dwz - install -D -m 644 $(srcdir)/dwz.1 $(DESTDIR)$(mandir)/man1/dwz.1 + install dwz $(DESTDIR)$(bindir)/dwz + install -m 644 $(srcdir)/dwz.1 $(DESTDIR)$(mandir)/man1/dwz.1 clean: rm -f $(OBJECTS) *~ core* dwz $(TEST_EXECS) $(DWZ_TEST_SOURCES) \ dwz.log dwz.sum