Skip to content

Commit 9ca5c18

Browse files
Refactor Makefile for improved Julia project management
- Simplify Julia package initialization and update commands - Use explicit project paths with `--project` flag - Streamline test and initialization targets - Update Manifest.toml with local package path
1 parent 80ba1a6 commit 9ca5c18

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

Makefile

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
jl:=julia
22

3-
init: src/*jl
4-
$(jl) -e 'd=pwd(); @assert isdir(d);\
5-
using Pkg: activate, instantiate, develop, precompile; \
6-
activate(d); instantiate(); activate(joinpath(d, "examples")); \
7-
develop(path=d); instantiate(); precompile();'
8-
@echo "Environment initialized at: $$PWD"
3+
init: src/* examples/*
4+
$(jl) --project=${PWD} -e 'using Pkg; Pkg.instantiate(); Pkg.precompile();'
5+
$(jl) --project=${PWD}/examples -e 'using Pkg; Pkg.develop(path="${PWD}"); Pkg.instantiate(); Pkg.precompile();'
6+
echo "Environment initialized at: ${PWD}"
97

10-
update: src/*jl
11-
$(jl) -e 'd=pwd(); @assert isdir(d);\
12-
using Pkg: activate, update, develop, precompile; \
13-
activate(d); update(); activate(joinpath(d, "examples")); \
14-
update(); precompile();'
15-
@echo "Environment updated at: $$PWD"
8+
update: src/* examples/*
9+
$(jl) --project=${PWD} -e 'using Pkg; Pkg.update()'
10+
$(jl) --project=${PWD}/examples -e 'using Pkg; Pkg.update(); Pkg.precompile()'
11+
echo "Environment updated at: ${PWD}"
1612

17-
test: test/*jl
18-
@echo "Running tests at: $$PWD"
19-
$(jl) -e 'd=pwd(); @assert isdir(d);\
20-
using Pkg: activate, test; \
21-
activate(d); test();'
13+
test: src/* test/*
14+
echo "Running tests at: ${PWD}"
15+
$(jl) --project=${PWD} -e 'using Pkg; Pkg.test();'
16+
17+
# examples: src/* examples/*
18+
# echo "Running examples at: ${PWD}"
19+
# $(jl) --project=${PWD}/examples -e 'using Pkg; include(joinpath(pwd(), "examples", "main.jl"));'

examples/Manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ version = "0.3.27+1"
2929

3030
[[deps.SimpleLinearAlgebra]]
3131
deps = ["LinearAlgebra"]
32-
path = "/Users/yangjunjie/.julia/dev/SimpleLinearAlgebra"
32+
path = "/Users/yangjunjie/work/SimpleLinearAlgebra.jl/SimpleLinearAlgebra"
3333
uuid = "555e9691-8231-4cde-a0d7-6dc20204a59a"
3434
version = "1.0.0-DEV"
3535

0 commit comments

Comments
 (0)