-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve cross-compile instructions and makefile support (#849)
Add a `--cross` argument to `configure` to indicate that the generated makefile's `make` should be like `make kernel`, and a pb-based bootstrap should rerun `configure` to build for the host machine instead of the specified target machine. Also, add support for `DESTDIR` as a more conventional alternative to the `--temproot` configure flag. While we're at it, recognize `CFLAGS_FOR_BUILD` for building `bin/zuo`. As part of the change to `configure`, having `CC_FOR_BUILD` set does not by itself disable the use of pb for creating or updating boot files. Depending on how boot files are obtained, `--force` now may be needed when using `CC_FOR_BUILD` as part of a cross compile that doesn't use `--cross`.
- Loading branch information
Showing
6 changed files
with
180 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# The `configure` script adjusts the next line: | ||
workarea=$(w) | ||
|
||
include $(workarea)/Mf-config | ||
|
||
# This is a simplified variant of the makefile that is | ||
# for cross compilation, where `kernel` is the only | ||
# build option and `build` is mapped to `kernel` | ||
|
||
.PHONY: build | ||
build: $(ZUO_DEP) | ||
+ $(ZUO) $(workarea) kernel MAKE="$(MAKE)" | ||
|
||
.PHONY: kernel | ||
kernel: $(ZUO_DEP) | ||
+ $(ZUO) $(workarea) kernel MAKE="$(MAKE)" | ||
|
||
.PHONY: install | ||
install: $(ZUO_DEP) | ||
$(ZUO) $(workarea) install MAKE="$(MAKE)" DESTDIR="$(DESTDIR)" | ||
|
||
.PHONY: clean | ||
clean: $(ZUO_DEP) | ||
+ $(ZUO) $(workarea) clean MAKE="$(MAKE)" | ||
$(RM_ZUO) | ||
|
||
# Using `+` here means that $(ZUO) gets built even if `-n`/`--dry-run` is provided to `make` | ||
$(ZUO_TARGET): $(srcdir)/zuo/zuo.c | ||
+ mkdir -p bin | ||
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DZUO_LIB_PATH='"'"$(upsrcdir)/zuo/lib"'"' -o $(ZUO) $(srcdir)/zuo/zuo.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.