$OpenBSD: patch-Makefile,v 1.9 2020/04/11 06:41:47 kirby Exp $

Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -92,7 +92,7 @@
 # RELEASE_FLAGS is flags for release builds.
 RELEASE_FLAGS =
 WARNINGS = \
-  -Werror -Wall -Wextra \
+  -Wall -Wextra \
   -Wformat-signedness \
   -Wlogical-op \
   -Wmissing-declarations \
@@ -310,7 +310,6 @@ ifdef RELEASE
       OPTLEVEL = -O3
     endif
   endif
-  CXXFLAGS += $(OPTLEVEL)
 
   ifdef LTO
     ifeq ($(NATIVE), osx)
@@ -368,7 +367,7 @@ endif
 ifeq ($(shell sh -c 'uname -o 2>/dev/null || echo not'),Cygwin)
   OTHERS += -std=gnu++14
 else
-  OTHERS += -std=c++14
+  OTHERS += -std=c++14 -I$(LOCALBASE)/include
 endif
 
 ifeq ($(CYGWIN),1)
@@ -522,11 +521,6 @@ ifdef MAPSIZE
     CXXFLAGS += -DMAPSIZE=$(MAPSIZE)
 endif
 
-ifeq ($(shell git rev-parse --is-inside-work-tree),true)
-  # We have a git repository, use git version
-  DEFINES += -DGIT_VERSION
-endif
-
 PKG_CONFIG = $(CROSS)pkg-config
 SDL2_CONFIG = $(CROSS)sdl2-config
 
@@ -699,7 +693,7 @@ ifeq ($(BSD), 1)
 
   # And similarly, their libcs don't have gettext built in
   ifeq ($(LOCALIZE),1)
-    LDFLAGS += -lintl -liconv
+    LDFLAGS += -L/usr/local/lib -lintl -liconv
   endif
 endif
 
@@ -825,7 +819,7 @@ ifdef LTO
   endif
 endif
 
-all: version $(CHECKS) $(TARGET) $(L10N) $(TESTS) validate-pr
+all: version $(CHECKS) $(TARGET) $(L10N) $(TESTS)
 	@
 
 $(TARGET): $(OBJS)
@@ -844,7 +838,6 @@ $(BUILD_PREFIX)$(TARGET_NAME).a: $(OBJS)
 .PHONY: version
 version:
 	@( VERSION_STRING=$(VERSION) ; \
-            [ -e ".git" ] && GITVERSION=$$( git describe --tags --always --dirty --match "[0-9A-Z]*.[0-9A-Z]*" ) && VERSION_STRING=$$GITVERSION ; \
             [ -e "$(SRC_DIR)/version.h" ] && OLDVERSION=$$(grep VERSION $(SRC_DIR)/version.h|cut -d '"' -f2) ; \
             if [ "x$$VERSION_STRING" != "x$$OLDVERSION" ]; then echo "#define VERSION \"$$VERSION_STRING\"" | tee $(SRC_DIR)/version.h ; fi \
          )
@@ -891,31 +884,31 @@ distclean:
 bindist: $(BINDIST)
 
 ifeq ($(TARGETSYSTEM), LINUX)
-DATA_PREFIX=$(DESTDIR)$(PREFIX)/share/cataclysm-dda/
-BIN_PREFIX=$(DESTDIR)$(PREFIX)/bin
-LOCALE_DIR=$(DESTDIR)$(PREFIX)/share/locale
+DATA_PREFIX=$(PREFIX)/share/cataclysm-dda/
+BIN_PREFIX=$(PREFIX)/bin
+LOCALE_DIR=$(PREFIX)/share/locale
 install: version $(TARGET)
 	mkdir -p $(DATA_PREFIX)
 	mkdir -p $(BIN_PREFIX)
-	install --mode=755 $(TARGET) $(BIN_PREFIX)
-	cp -R --no-preserve=ownership data/core $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/font $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/json $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/mods $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/names $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/raw $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/motd $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/credits $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/title $(DATA_PREFIX)
-	cp -R --no-preserve=ownership data/help $(DATA_PREFIX)
+	install -m 755 $(TARGET) $(BIN_PREFIX)
+	cp -R data/core $(DATA_PREFIX)
+	cp -R data/font $(DATA_PREFIX)
+	cp -R data/json $(DATA_PREFIX)
+	cp -R data/mods $(DATA_PREFIX)
+	cp -R data/names $(DATA_PREFIX)
+	cp -R data/raw $(DATA_PREFIX)
+	cp -R data/motd $(DATA_PREFIX)
+	cp -R data/credits $(DATA_PREFIX)
+	cp -R data/title $(DATA_PREFIX)
+	cp -R data/help $(DATA_PREFIX)
 ifdef TILES
-	cp -R --no-preserve=ownership gfx $(DATA_PREFIX)
+	cp -R gfx $(DATA_PREFIX)
 endif
 ifdef SOUND
-	cp -R --no-preserve=ownership data/sound $(DATA_PREFIX)
+	cp -R data/sound $(DATA_PREFIX)
 endif
-	install --mode=644 data/changelog.txt data/cataicon.ico data/fontdata.json \
-                   LICENSE.txt LICENSE-OFL-Terminus-Font.txt -t $(DATA_PREFIX)
+	install -m 644 data/changelog.txt data/cataicon.ico data/fontdata.json \
+                   LICENSE.txt LICENSE-OFL-Terminus-Font.txt $(DATA_PREFIX)
 	mkdir -p $(LOCALE_DIR)
 ifdef LANGUAGES
 	LOCALE_DIR=$(LOCALE_DIR) lang/compile_mo.sh $(LANGUAGES)
@@ -1074,11 +1067,6 @@ etags: $(ASTYLE_SOURCES)
 astyle: $(ASTYLE_SOURCES)
 	$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)
 
-# Test whether the system has a version of astyle that supports --dry-run
-ifeq ($(shell if $(ASTYLE_BINARY) -Q -X --dry-run src/game.h > /dev/null; then echo foo; fi),foo)
-  ASTYLE_CHECK=$(shell LC_ALL=C $(ASTYLE_BINARY) --options=.astylerc --dry-run -X -Q $(ASTYLE_SOURCES))
-endif
-
 astyle-check:
 ifdef ASTYLE_CHECK
 	$(info $(ASTYLE_BINARY) -V: $(shell $(ASTYLE_BINARY) -V))
@@ -1121,7 +1109,7 @@ ifneq ($(CYGWIN),1)
 	@build-scripts/validate_pr_in_jenkins
 endif
 
-.PHONY: tests check ctags etags clean-tests install lint validate-pr
+.PHONY: tests check ctags etags clean-tests install lint
 
 -include $(SOURCES:$(SRC_DIR)/%.cpp=$(DEPDIR)/%.P)
 -include ${OBJS:.o=.d}
