restructure Make
This commit is contained in:
parent
2711027dcf
commit
c1d82b5046
2 changed files with 35 additions and 30 deletions
38
config.mk
38
config.mk
|
|
@ -1,23 +1,25 @@
|
|||
# === C Compiler COnfiguration ===
|
||||
COMPILER := gcc
|
||||
CFLAGS :=
|
||||
LDFLAGS :=
|
||||
# === C Compiler Configuration ===
|
||||
CC := gcc
|
||||
# CCOMPILER = $$([ -x "$$(command -v bear)" ] && echo 'bear -- ') $(CC)
|
||||
CCOMPILER = $(CC)
|
||||
CFLAGS := -Wall -Wextra -std=gnu23 -O
|
||||
CFLAGS_DBG := -g
|
||||
|
||||
# === Nix Mutations ===
|
||||
ifdef NIX_PATH
|
||||
# === C Linker Configuration ===
|
||||
CLINKER = $(CC)
|
||||
LDFLAGS := -lpipewire-0.3 -lm -lc
|
||||
LDFLAGS_DBG := -g
|
||||
|
||||
ifdef NIX_CC
|
||||
# TODO: will using the Nix gcc-wrapper break Bear?
|
||||
override COMPILER := $(NIX_CC)/bin/gcc
|
||||
endif # NIX_CC
|
||||
# # === Nix Mutations ===
|
||||
# ifdef NIX_PATH
|
||||
|
||||
# flake.nix adds NIX_CFLAGS_COMPILER/DORNE_LDFLAGS to env
|
||||
CFLAGS += $(NIX_CFLAGS_COMPILE)
|
||||
LDFLAGS += $(DORNE_LDFLAGS)
|
||||
# ifdef NIX_CC
|
||||
# # TODO: will using the Nix gcc-wrapper break Bear?
|
||||
# override COMPILER := $(NIX_CC)/bin/gcc
|
||||
# endif # NIX_CC
|
||||
|
||||
endif # NIX_PATH
|
||||
# # flake.nix adds NIX_CFLAGS_COMPILER/DORNE_LDFLAGS to env
|
||||
# CFLAGS += $(NIX_CFLAGS_COMPILE)
|
||||
# LDFLAGS += $(DORNE_LDFLAGS)
|
||||
|
||||
|
||||
# C Compiler+Linker Commands
|
||||
CC = $$([ -x "$$(command -v bear)" ] && echo 'bear -- ') $(COMPILER)
|
||||
LD = $(COMPILER)
|
||||
# endif # NIX_PATH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue