Skip to content

Commit

Permalink
build: Fix PROD flags confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Nov 10, 2024
1 parent a75102e commit f68e1a8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions jinx-config
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,5 @@ if [ "$in_container" = true ]; then
mkdir -p "${VMODULES}"/cache
mkdir -p /tmp/v_$(id -u)
fi

PROD=true
5 changes: 3 additions & 2 deletions jinx-config-debug
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
. ${base_dir}/jinx-config
export VINIX_PROD=no
export CFLAGS="$CFLAGS -g"

PROD=false
CFLAGS="$CFLAGS -g"
4 changes: 2 additions & 2 deletions kernel/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(call USER_VARIABLE,VFLAGS,)
# User controllable linker flags. We set none by default.
$(call USER_VARIABLE,LDFLAGS,)

$(call USER_VARIABLE,VINIX_PROD,)
$(call USER_VARIABLE,PROD,)

# Ensure the dependencies have been obtained.
ifneq ($(shell ( test '$(MAKECMDGOALS)' = clean || test '$(MAKECMDGOALS)' = distclean ); echo $$?),0)
Expand Down Expand Up @@ -123,7 +123,7 @@ override VFLAGS += \
-gc none \
-d no_backtrace

ifeq ($(VINIX_PROD),no)
ifeq ($(PROD),false)
override VFLAGS += -warn-about-allocs
else
override VFLAGS += -prod
Expand Down
1 change: 1 addition & 0 deletions recipes/kernel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build() {
cp -rpf "${source_dir}"/. ./

make -j${parallelism} \
PROD="$PROD" \
CC=${OS_TRIPLET}-gcc \
LD=${OS_TRIPLET}-ld \
AR=${OS_TRIPLET}-ar \
Expand Down
1 change: 1 addition & 0 deletions recipes/util-vinix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build() {
cp -rp "${source_dir}"/. ./

make -j${parallelism} \
PROD="$PROD" \
CC=${OS_TRIPLET}-gcc \
VFLAGS="-os vinix -gc none" \
CFLAGS="$TARGET_CFLAGS" \
Expand Down
11 changes: 3 additions & 8 deletions util-vinix/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@ override USER_VARIABLE = $(if $(filter $(origin $(1)),default undefined),$(eval
$(call USER_VARIABLE,CC,cc)
$(call USER_VARIABLE,V,v)

VINIX_PROD ?=
ifeq ($(VINIX_PROD),no)
override PROD := false
else
override PROD := true
endif

$(call USER_VARIABLE,VFLAGS,)
$(call USER_VARIABLE,CFLAGS,-g -O2 -pipe)
$(call USER_VARIABLE,LDFLAGS,)

$(call USER_VARIABLE,DESTDIR,)
$(call USER_VARIABLE,PREFIX,/usr/local)

ifeq ($(PROD), true)
$(call USER_VARIABLE,PROD,)

ifeq ($(PROD),true)
override VFLAGS += -prod
endif

Expand Down

0 comments on commit f68e1a8

Please sign in to comment.