Commit 3237ebaf by Baruch Sterin

CMake, Makefile: pass the location of arch_flags to the makefile, this way the…

CMake, Makefile: pass the location of arch_flags to the makefile, this way the cmake build does not write to the soruce directory
parent f7c969ca
...@@ -53,6 +53,7 @@ execute_process( ...@@ -53,6 +53,7 @@ execute_process(
make make
${ABC_READLINE_FLAGS} ${ABC_READLINE_FLAGS}
${ABC_USE_NAMESPACE} ${ABC_USE_NAMESPACE}
ARCHFLAGS_EXE=${CMAKE_CURRENT_BINARY_DIR}/abc_arch_flags_program.exe
ABC_MAKE_NO_DEPS=1 ABC_MAKE_NO_DEPS=1
CC=${CMAKE_C_COMPILER} CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER} CXX=${CMAKE_CXX_COMPILER}
......
...@@ -34,12 +34,14 @@ MODULES := \ ...@@ -34,12 +34,14 @@ MODULES := \
all: $(PROG) all: $(PROG)
default: $(PROG) default: $(PROG)
arch_flags : arch_flags.c ARCHFLAGS_EXE ?= ./arch_flags
$(CC) arch_flags.c -o arch_flags
$(ARCHFLAGS_EXE) : arch_flags.c
$(CC) arch_flags.c -o $(ARCHFLAGS_EXE)
INCLUDES += -Isrc 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) ARCHFLAGS := $(ARCHFLAGS)
OPTFLAGS ?= -g -O OPTFLAGS ?= -g -O
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment