From 15732ecd82b2ab4b79cc5fd64eeb310826ce3a83 Mon Sep 17 00:00:00 2001 From: Greg Land Date: Tue, 13 Jun 2023 13:30:23 -0400 Subject: [PATCH] Fixed issue preventing debug builds using Makefile install-program was always assuming that release was the only target directory that could exist. This would cause install-program to fail with DEBUG=1 passed to the makefile. DEBUG flag now correctly sets a TARGET and sets the build profile to dev for debug builds. --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ecdb3640..29df14e9 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ DEBUG ?= 0 ifeq ($(DEBUG),0) ARGS += --release TARGET = release +else + ARGS += --profile dev + TARGET = debug endif VENDORED ?= 0 @@ -39,11 +42,11 @@ distclean: rm -rf .cargo vendor vendor.tar.xz install-program: - $(INSTALL_PROGRAM) "./target/release/$(BIN_ROG)" "$(DESTDIR)$(bindir)/$(BIN_ROG)" + $(INSTALL_PROGRAM) "./target/$(TARGET)/$(BIN_ROG)" "$(DESTDIR)$(bindir)/$(BIN_ROG)" - $(INSTALL_PROGRAM) "./target/release/$(BIN_C)" "$(DESTDIR)$(bindir)/$(BIN_C)" - $(INSTALL_PROGRAM) "./target/release/$(BIN_D)" "$(DESTDIR)$(bindir)/$(BIN_D)" - $(INSTALL_PROGRAM) "./target/release/$(BIN_U)" "$(DESTDIR)$(bindir)/$(BIN_U)" + $(INSTALL_PROGRAM) "./target/$(TARGET)/$(BIN_C)" "$(DESTDIR)$(bindir)/$(BIN_C)" + $(INSTALL_PROGRAM) "./target/$(TARGET)/$(BIN_D)" "$(DESTDIR)$(bindir)/$(BIN_D)" + $(INSTALL_PROGRAM) "./target/$(TARGET)/$(BIN_U)" "$(DESTDIR)$(bindir)/$(BIN_U)" install-data: $(INSTALL_DATA) "./rog-control-center/data/$(BIN_ROG).desktop" "$(DESTDIR)$(datarootdir)/applications/$(BIN_ROG).desktop"