summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2015-11-12 11:43:59 -0800
committerBaruch Sterin <baruchs@gmail.com>2015-11-12 11:43:59 -0800
commit3237ebafaa36ccc114a4274ff9ca9f5dfe61821b (patch)
tree5f423558aa43814c0e992b9dbd5c884a7dd54367 /Makefile
parentf7c969ca66649627281510b8c63d867288faafd7 (diff)
downloadabc-3237ebafaa36ccc114a4274ff9ca9f5dfe61821b.tar.gz
abc-3237ebafaa36ccc114a4274ff9ca9f5dfe61821b.tar.bz2
abc-3237ebafaa36ccc114a4274ff9ca9f5dfe61821b.zip
CMake, Makefile: pass the location of arch_flags to the makefile, this way the cmake build does not write to the soruce directory
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4b5190d0..f05d39b5 100644
--- a/Makefile
+++ b/Makefile
@@ -34,12 +34,14 @@ MODULES := \
all: $(PROG)
default: $(PROG)
-arch_flags : arch_flags.c
- $(CC) arch_flags.c -o arch_flags
+ARCHFLAGS_EXE ?= ./arch_flags
+
+$(ARCHFLAGS_EXE) : arch_flags.c
+ $(CC) arch_flags.c -o $(ARCHFLAGS_EXE)
INCLUDES += -Isrc
-ARCHFLAGS ?= $(shell $(CC) arch_flags.c -o arch_flags && ./arch_flags)
+ARCHFLAGS ?= $(shell $(CC) arch_flags.c -o $(ARCHFLAGS_EXE) && $(ARCHFLAGS_EXE))
ARCHFLAGS := $(ARCHFLAGS)
OPTFLAGS ?= -g -O