From 16c4040b27ebba67d95090b14869ebad1323e2a9 Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 11 Jun 2019 19:58:33 -0700 Subject: [PATCH] tup: Custom CFLAGS/LDFLAGS, fix THREAD_MODULE config; --- Tuprules.tup | 5 ++++- tup.config | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Tuprules.tup b/Tuprules.tup index b10779da..e8e130c6 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -15,7 +15,7 @@ CFLAGS += -Wno-typedef-redefinition CFLAGS += -Wno-unused-parameter # stdatomic.h is used for atomic refcounts when threads are enabled, and that's a C11 feature. -ifeq (@(MODULE_THREAD),y) +ifeq (@(THREAD),y) CFLAGS += -std=c11 else CFLAGS += -std=c99 @@ -84,6 +84,9 @@ LDFLAGS += @(OPENVR_LDFLAGS) LDFLAGS += @(OPENXR_LDFLAGS) LDFLAGS += @(ENET_LDFLAGS) +CFLAGS += @(CFLAGS) +LDFLAGS += @(LDFLAGS) + # Macros !compile = |> ^ CC %f^ @(CC) $(CFLAGS) $(CFLAGS_y) -c %f -o %o |> $(ROOT)/.obj/%B.o $(ROOT)/ !link = |> ^ LD %o^ @(CC) $(LDFLAGS) -o %o |> diff --git a/tup.config b/tup.config index 826fa174..be9399ff 100644 --- a/tup.config +++ b/tup.config @@ -41,8 +41,11 @@ CONFIG_GL=GL ## Compiler options # The CC option stands for "C Compiler". Some common compilers are clang and gcc. # Debug builds compile faster and have debug symbols, but the executable is bigger and slower. +# Also, extra compiler flags (CFLAGS) and linker flags (LDFLAGS) can be provided. CONFIG_CC=clang CONFIG_DEBUG=y +CONFIG_CFLAGS= +CONFIG_LDFLAGS= ## Libraries # Explicit compiler flags for compilation (CFLAGS) and linking (LDFLAGS) go here.