Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompile with cargo and rebuild temacs when the Rust source changes #108

Merged
merged 1 commit into from Jan 22, 2017

Conversation

spacecowboy
Copy link
Contributor

  • Moved rust compilation inside the src-Makefile
  • Added a target to build the build the remacs archive. This target
    depends on all rust src files

Examples

All examples assume a previously completed run of make or make src and abbreviates some output with [...]

Updated rust source file: runs cargo and builds temacs

$ touch rust_src/src/lisp.rs
$ make src
make -C lib all
[...]
make[2]: 'libXMenu11.a' is up to date.
make[2]: Leaving directory '/home/jonas/workspace/remacs/oldXMenu'
RUSTFLAGS= \
cargo build --release --manifest-path ../rust_src/Cargo.toml
   Compiling remacs v0.1.0 (file:///home/jonas/workspace/remacs/src/../rust_src)
note: link against the following native artifacts when linking against this static library

note: the order and any duplication can be significant on some platforms, and so may need to be preserved

note: library: util

note: library: dl

note: library: pthread

note: library: gcc_s

note: library: c

note: library: m

note: library: rt

note: library: util

    Finished release [optimized] target(s) in 1.44 secs
mkdir -p ../rust_src/target/
echo "--release " > ../rust_src/target/.rustflags.tmp
diff -q ../rust_src/target/.rustflags ../rust_src/target/.rustflags.tmp || cp ../rust_src/target/.rustflags.tmp ../rust_src/target/.rustflags
rm -f ../rust_src/target/.rustflags.tmp
[...]
  CCLD     temacs
/bin/mkdir -p ../etc
make -C ../lisp update-subdirs
make[2]: Entering directory '/home/jonas/workspace/remacs/lisp'
make[2]: Leaving directory '/home/jonas/workspace/remacs/lisp'
./temacs --batch  --load loadup bootstrap
[...]
Adding name remacs-26.0.50.2
ln -f remacs bootstrap-emacs
make[1]: Leaving directory '/home/jonas/workspace/remacs/src'

Updated C source file: does NOT run cargo and builds temacs

$ touch src/lisp.h
$ make src
make -C lib all
[...]
make[2]: 'libXMenu11.a' is up to date.
make[2]: Leaving directory '/home/jonas/workspace/remacs/oldXMenu'
  CC       dispnew.o
[...]
mkdir -p ../rust_src/target/
echo "--release " > ../rust_src/target/.rustflags.tmp
diff -q ../rust_src/target/.rustflags ../rust_src/target/.rustflags.tmp || cp ../rust_src/target/.rustflags.tmp ../rust_src/target/.rustflags
rm -f ../rust_src/target/.rustflags.tmp
[...]
  CCLD     temacs
/bin/mkdir -p ../etc
make -C ../lisp update-subdirs
make[2]: Entering directory '/home/jonas/workspace/remacs/lisp'
make[2]: Leaving directory '/home/jonas/workspace/remacs/lisp'
./temacs --batch  --load loadup bootstrap
[...]
Adding name remacs-26.0.50.7
ln -f remacs bootstrap-emacs
make[1]: Leaving directory '/home/jonas/workspace/remacs/src'

@@ -193,6 +193,7 @@ nextstep/Emacs.app/
nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop
nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist
src/bootstrap-emacs
lib-src/remacsclient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #104

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Rebased.

* Moved rust compilation inside the src-Makefile
* Added a target to build the build the remacs archive. This target
  depends on all rust src files
Copy link
Collaborator

@Wilfred Wilfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants