make: directly include base main makefile

This commit is contained in:
Benoit Pierre
2024-07-31 01:55:36 +02:00
committed by Frans de Jonge
parent 4855a8695d
commit 1add3b5772
5 changed files with 27 additions and 35 deletions

View File

@@ -6,7 +6,7 @@ source "${CI_DIR}/common.sh"
# Build.
cmd=(make all)
if [[ -d base/build ]]; then
if [[ -d build ]]; then
cmd+=(--assume-old=base)
fi
"${cmd[@]}"

View File

@@ -54,15 +54,15 @@ jobs:
# Restore / setup caches. {{{
- run:
name: Generate cache key
command: make -C base TARGET= cache-key
command: make TARGET= cache-key
- restore_cache:
name: Restore build directory
keys:
- &CACHE_KEY_BUILD_DIR '<< pipeline.parameters.cache_epoch >>-{{ .Environment.CIRCLE_JOB }}-build-{{ arch }}-{{ checksum "base/cache-key" }}'
- &CACHE_KEY_BUILD_DIR '<< pipeline.parameters.cache_epoch >>-{{ .Environment.CIRCLE_JOB }}-build-{{ arch }}-{{ checksum "cache-key" }}'
- restore_cache:
name: Restore build cache
keys:
- &CACHE_KEY_BUILD_CACHE '<< pipeline.parameters.cache_epoch >>-{{ .Environment.CIRCLE_JOB }}-ccache-{{ arch }}-{{ checksum "base/cache-key" }}'
- &CACHE_KEY_BUILD_CACHE '<< pipeline.parameters.cache_epoch >>-{{ .Environment.CIRCLE_JOB }}-ccache-{{ arch }}-{{ checksum "cache-key" }}'
- '<< pipeline.parameters.cache_epoch >>-{{ .Environment.CIRCLE_JOB }}-ccache-{{ arch }}-'
- run:
name: Setup build cache
@@ -85,7 +85,7 @@ jobs:
command: |
set -x
# Trim the build directory.
rm -rf base/build/{cmake,staging,thirdparty}
rm -rf build/{cmake,staging,thirdparty}
ccache --cleanup >/dev/null
ccache --show-stats --verbose
- save_cache:
@@ -97,7 +97,7 @@ jobs:
name: Save build directory
key: *CACHE_KEY_BUILD_DIR
paths:
- base/build
- build
# }}}
# Tests / coverage. {{{
# Our lovely unit tests.

View File

@@ -92,14 +92,14 @@ jobs:
# Restore / setup caches. {{{
- name: Generate cache key
run: make -C base TARGET= cache-key
run: make TARGET= cache-key
- name: Restore build directory
id: build-restore
uses: actions/cache/restore@v4
with:
path: base/build
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-build-${{ hashFiles('base/cache-key') }}
path: build
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-build-${{ hashFiles('cache-key') }}
- name: Restore build cache
id: ccache-restore
@@ -107,7 +107,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-ccache-${{ hashFiles('base/cache-key') }}
key: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-ccache-${{ hashFiles('cache-key') }}
restore-keys: ${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ runner.arch }}-ccache-
- name: Install ccache
@@ -152,7 +152,7 @@ jobs:
run: |
set -x
# Trim the build directory.
rm -rf base/build/{cmake,staging,thirdparty}
rm -rf build/{cmake,staging,thirdparty}
ccache --cleanup >/dev/null
ccache --show-stats --verbose
@@ -167,7 +167,7 @@ jobs:
uses: actions/cache/save@v4
if: steps.build-restore.outputs.cache-hit != 'true'
with:
path: base/build
path: build
key: ${{ steps.build-restore.outputs.cache-primary-key }}
# }}}

View File

@@ -1,7 +1,8 @@
PHONY = all android-ndk android-sdk base clean coverage doc fetchthirdparty po pot static-check test testfront
PHONY = all android-ndk android-sdk base clean coverage distclean doc fetchthirdparty po pot re static-check test testfront
SOUND = $(INSTALL_DIR)/%
# koreader-base directory
KOR_BASE?=base
KOR_BASE ?= base
include $(KOR_BASE)/Makefile.defs
@@ -51,12 +52,7 @@ WIN32_DIR=$(PLATFORM_DIR)/win32
INSTALL_FILES=reader.lua setupkoenv.lua frontend resources defaults.lua datastorage.lua \
l10n tools README.md COPYING
ifeq ($(abspath $(OUTPUT_DIR)),$(OUTPUT_DIR))
ABSOLUTE_OUTPUT_DIR = $(OUTPUT_DIR)
else
ABSOLUTE_OUTPUT_DIR = $(KOR_BASE)/$(OUTPUT_DIR)
endif
OUTPUT_DIR_ARTIFACTS = $(ABSOLUTE_OUTPUT_DIR)/!(cache|cmake|history|staging|thirdparty)
OUTPUT_DIR_ARTIFACTS = $(abspath $(OUTPUT_DIR))/!(cache|cmake|history|staging|thirdparty)
all: base
install -d $(INSTALL_DIR)/koreader
@@ -99,8 +95,7 @@ ifneq (,$(IS_RELEASE))
rm -rf $(INSTALL_DIR)/koreader/data/{cr3.ini,desktop,devices,dict,manual,tessdata}
endif
base:
$(MAKE) -C $(KOR_BASE)
base: base-all
$(INSTALL_DIR)/koreader/.busted: .busted
$(SYMLINK) .busted $@
@@ -128,6 +123,9 @@ coverage: $(INSTALL_DIR)/koreader/.luacov
+$$(($$(grep -nm1 -e "^Summary$$" luacov.report.out|cut -d: -f1)-1)) \
luacov.report.out
ifeq (,$(wildcard $(KOR_BASE)/Makefile))
$(KOR_BASE)/Makefile: fetchthirdparty
endif
ifeq (,$(wildcard $(KOR_BASE)/Makefile.defs))
$(KOR_BASE)/Makefile.defs: fetchthirdparty
endif
@@ -149,21 +147,18 @@ else
endif
$(MAKE) -C $(KOR_BASE) fetchthirdparty
VERBOSE ?= @
Q = $(VERBOSE:1=)
clean:
clean: base-clean
rm -rf $(INSTALL_DIR)
$(Q:@=@echo 'MAKE -C base clean'; &> /dev/null) \
$(MAKE) -C $(KOR_BASE) clean
ifeq ($(TARGET), android)
$(MAKE) -C $(CURDIR)/platform/android/luajit-launcher clean
endif
dist-clean: clean
rm -rf $(INSTALL_DIR)
$(MAKE) -C $(KOR_BASE) dist-clean
distclean: clean base-distclean
$(MAKE) -C doc clean
re: clean
$(MAKE) all
# Include target specific rules.
ifneq (,$(wildcard make/$(TARGET).mk))
include make/$(TARGET).mk
@@ -208,7 +203,4 @@ doc:
.NOTPARALLEL:
.PHONY: $(PHONY)
LEFTOVERS = $(filter-out $(PHONY) $(INSTALL_DIR)/%,$(MAKECMDGOALS))
.PHONY: $(LEFTOVERS)
$(LEFTOVERS):
$(MAKE) -C $(KOR_BASE) $@
include $(KOR_BASE)/Makefile

2
base

Submodule base updated: 0d6abcf611...29f0425780