Allow the prefix to be specified with PREFIX. Do not override CC that might be set as an env var. Prepend standard flags to CFLAGS rather than appending so as not to override optimization flags that the user might have set in CFLAGS. Do not add -lstdc++; using a C++ compiler automatically uses the right C++ standard library. Use an unversioned doc directory. It's still crazy that this makefile uses CC and CFLAGS for C++ files but oh well. --- makefile.orig 2019-07-23 09:18:51.000000000 -0500 +++ makefile 2022-01-24 05:44:09.000000000 -0600 @@ -33,14 +33,15 @@ DESTDIR= # Where to install -INSTALL_PREFIX=$(DESTDIR)/usr +PREFIX?=/usr +INSTALL_PREFIX=$(DESTDIR)$(PREFIX) # Compiler -CC=g++ +CC?=g++ # Standard optimization settings, with support for # default compilation flags -CFLAGS+=-O2 -I. +CFLAGS:=-O2 -I. $(CFLAGS) # Standard optimization settings, # tested also on Mac OS X @@ -115,7 +116,7 @@ ALL: drc glsweep lsconv drc: $(DRCSRC) - $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) -o drc $(DRCSRC) -lm -lstdc++ + $(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) -o drc $(DRCSRC) -lm glsweep: $(GLSWEEPSRC) $(CC) $(LDFLAGS) $(CPPFLAGS) $(GLSCFLAGS) -o glsweep $(GLSWEEPSRC) -lm @@ -135,5 +136,5 @@ cp --recursive --no-dereference --preserve=links --no-preserve=ownership $(TARGET_TARGETS) $(INSTALL_PREFIX)/share/drc/target/ install -d $(INSTALL_PREFIX)/share/drc/mic/ cp --recursive --no-dereference --preserve=links --no-preserve=ownership $(MIC_TARGETS) $(INSTALL_PREFIX)/share/drc/mic/ - install -d $(INSTALL_PREFIX)/share/doc/drc-$(VERSION)/ - install $(DOC_TARGETS) $(INSTALL_PREFIX)/share/doc/drc-$(VERSION)/ + install -d $(INSTALL_PREFIX)/share/doc/drc/ + install $(DOC_TARGETS) $(INSTALL_PREFIX)/share/doc/drc/