$OpenBSD: patch-Makefile,v 1.2 2017/08/14 12:20:57 dcoppa Exp $

Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -6,10 +6,10 @@ VERSION = 1.3.5
 PREFIX  ?= /usr/local
 CC      ?= gcc
 # using OPTFLAGS/OPTLDFLAGS for compatibilty with old scripts using this makefile
-OPTFLAGS = -O2 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
+OPTFLAGS = -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections
 OPTLDFLAGS =
-CFLAGS = $(OPTFLAGS)
-LDFLAGS = $(OPTLDFLAGS)
+CFLAGS += $(OPTFLAGS)
+LDFLAGS += $(OPTLDFLAGS)
 ADDCFLAGS =
 ADDLDFLAGS =
 ALLCFLAGS = -pipe $(CFLAGS) $(ADDCFLAGS) \
@@ -71,7 +71,7 @@ lib-shared: $(SHAREDLIB)
 lib-static: $(LIBRHASH)
 
 install: build-install-binary install-data install-symlinks
-install-shared: build-install-shared-binary install-data install-symlinks
+install-shared: build-install-shared-binary install-lib-static install-lib-shared install-data install-symlinks
 install-data: install-man install-conf
 uninstall: uninstall-binary uninstall-data uninstall-symlinks uninstall-lib
 
@@ -112,8 +112,8 @@ install-man:
 	$(INSTALL_DATA) dist/rhash.1 $(DESTDIR)$(MANDIR)/man1/rhash.1
 
 install-conf:
-	$(INSTALL) -d $(DESTDIR)/etc
-	tr -d \\r < dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) rc.tmp $(DESTDIR)/etc/rhashrc
+	$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/examples/$(PROGNAME)
+	tr -d \\r < dist/rhashrc.sample > rc.tmp && $(INSTALL_DATA) rc.tmp $(DESTDIR)$(PREFIX)/share/examples/$(PROGNAME)/rhashrc
 	rm -f rc.tmp
 
 # dependencies should be properly set, otherwise 'make -j<n>' can fail
@@ -178,7 +178,7 @@ $(TARGET): $(OBJECTS) $(LIBRHASH)
 	$(CC) $(OBJECTS) -o $@ $(ALLLDFLAGS)
 
 $(SHARED_TRG): $(OBJECTS) $(SHAREDLIB)
-	$(CC) $(OBJECTS) $(SHRDLFLAGS) -o $(SHARED_TRG) $(SHAREDLIB)
+	$(CC) $(OBJECTS) $(SHRDLFLAGS) -o $(SHARED_TRG) $(LDLIBRHASH)
 
 # NOTE: dependences were generated by 'gcc -Ilibrhash -MM *.c'
 # we are using plain old makefile style to support BSD make
