From d826602e4940e4b206105c8e25f196c23798c056 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Thu, 20 Jul 2023 13:38:49 +0200 Subject: [PATCH] build: Allow out of tree builds. --- projects/unix/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/unix/Makefile b/projects/unix/Makefile index 9ee7226..a257137 100644 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -91,10 +91,14 @@ ifeq ("$(CPU)","OTHER") PIC ?= 1 endif +# directory paths +SRCDIR = ../../src +OBJDIR = _obj$(POSTFIX) + # base CFLAGS, LDLIBS, and LDFLAGS OPTFLAGS ?= -O3 -flto WARNFLAGS ?= -Wall -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -D_GNU_SOURCE=1 +CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I$(SRCDIR) -D_GNU_SOURCE=1 LDFLAGS += $(SHARED) LDLIBS += -lm @@ -229,9 +233,6 @@ ifeq ($(PLUGINDIR),) PLUGINDIR := $(LIBDIR)/mupen64plus endif -SRCDIR = ../../src -OBJDIR = _obj$(POSTFIX) - # list of source files to compile SOURCE = \ $(SRCDIR)/plugin_front.c \