mirror of
https://github.com/janet-lang/janet
synced 2025-11-20 17:24:48 +00:00
Merge pull request #1656 from jpaquim/build-system-consistency
Minor adjustments to Makefile
This commit is contained in:
@@ -61,7 +61,7 @@ ensure a consistent code style for C.
|
|||||||
|
|
||||||
## Janet style
|
## Janet style
|
||||||
|
|
||||||
All janet code in the project should be formatted similar to the code in core.janet.
|
All janet code in the project should be formatted similar to the code in src/boot/boot.janet.
|
||||||
The auto formatting from janet.vim will work well.
|
The auto formatting from janet.vim will work well.
|
||||||
|
|
||||||
## Typo Fixing and One-Line changes
|
## Typo Fixing and One-Line changes
|
||||||
|
|||||||
29
Makefile
29
Makefile
@@ -261,6 +261,7 @@ $(JANET_STATIC_LIBRARY): $(JANET_TARGET_OBJECTS)
|
|||||||
# Testing assumes HOSTCC=CC
|
# Testing assumes HOSTCC=CC
|
||||||
|
|
||||||
TEST_SCRIPTS=$(wildcard test/suite*.janet)
|
TEST_SCRIPTS=$(wildcard test/suite*.janet)
|
||||||
|
EXAMPLE_SCRIPTS=$(wildcard examples/*.janet)
|
||||||
|
|
||||||
repl: $(JANET_TARGET)
|
repl: $(JANET_TARGET)
|
||||||
$(RUN) ./$(JANET_TARGET)
|
$(RUN) ./$(JANET_TARGET)
|
||||||
@@ -268,21 +269,26 @@ repl: $(JANET_TARGET)
|
|||||||
debug: $(JANET_TARGET)
|
debug: $(JANET_TARGET)
|
||||||
$(DEBUGGER) ./$(JANET_TARGET)
|
$(DEBUGGER) ./$(JANET_TARGET)
|
||||||
|
|
||||||
VALGRIND_COMMAND=valgrind --leak-check=full --quiet
|
VALGRIND_COMMAND=$(RUN) valgrind --leak-check=full --quiet
|
||||||
|
CALLGRIND_COMMAND=$(RUN) valgrind --tool=callgrind
|
||||||
|
|
||||||
valgrind: $(JANET_TARGET)
|
valgrind: $(JANET_TARGET)
|
||||||
$(VALGRIND_COMMAND) ./$(JANET_TARGET)
|
$(VALGRIND_COMMAND) ./$(JANET_TARGET)
|
||||||
|
|
||||||
test: $(JANET_TARGET) $(TEST_PROGRAMS)
|
test: $(JANET_TARGET) $(TEST_SCRIPTS) $(EXAMPLE_SCRIPTS)
|
||||||
for f in test/suite*.janet; do $(RUN) ./$(JANET_TARGET) "$$f" || exit; done
|
for f in test/suite*.janet; do $(RUN) ./$(JANET_TARGET) "$$f" || exit; done
|
||||||
for f in examples/*.janet; do $(RUN) ./$(JANET_TARGET) -k "$$f"; done
|
for f in examples/*.janet; do $(RUN) ./$(JANET_TARGET) -k "$$f"; done
|
||||||
|
|
||||||
valtest: $(JANET_TARGET) $(TEST_PROGRAMS)
|
valtest: $(JANET_TARGET) $(TEST_SCRIPTS) $(EXAMPLE_SCRIPTS)
|
||||||
for f in test/suite*.janet; do $(VALGRIND_COMMAND) ./$(JANET_TARGET) "$$f" || exit; done
|
for f in test/suite*.janet; do $(VALGRIND_COMMAND) ./$(JANET_TARGET) "$$f" || exit; done
|
||||||
for f in examples/*.janet; do ./$(JANET_TARGET) -k "$$f"; done
|
for f in examples/*.janet; do $(VALGRIND_COMMAND) ./$(JANET_TARGET) -k "$$f"; done
|
||||||
|
|
||||||
callgrind: $(JANET_TARGET)
|
callgrind: $(JANET_TARGET)
|
||||||
for f in test/suite*.janet; do valgrind --tool=callgrind ./$(JANET_TARGET) "$$f" || exit; done
|
$(CALLGRIND_COMMAND) ./$(JANET_TARGET)
|
||||||
|
|
||||||
|
calltest: $(JANET_TARGET) $(TEST_SCRIPTS) $(EXAMPLE_SCRIPTS)
|
||||||
|
for f in test/suite*.janet; do $(CALLGRIND_COMMAND) ./$(JANET_TARGET) "$$f" || exit; done
|
||||||
|
for f in examples/*.janet; do $(CALLGRIND_COMMAND) ./$(JANET_TARGET) -k "$$f"; done
|
||||||
|
|
||||||
########################
|
########################
|
||||||
##### Distribution #####
|
##### Distribution #####
|
||||||
@@ -413,9 +419,6 @@ clean:
|
|||||||
-rm -rf build vgcore.* callgrind.*
|
-rm -rf build vgcore.* callgrind.*
|
||||||
-rm -rf test/install/build test/install/modpath
|
-rm -rf test/install/build test/install/modpath
|
||||||
|
|
||||||
test-install:
|
|
||||||
echo "JPM has been removed from default install."
|
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo
|
@echo
|
||||||
@echo 'Janet: A Dynamic Language & Bytecode VM'
|
@echo 'Janet: A Dynamic Language & Bytecode VM'
|
||||||
@@ -427,7 +430,8 @@ help:
|
|||||||
@echo ' make test Test a built Janet'
|
@echo ' make test Test a built Janet'
|
||||||
@echo ' make valgrind Assess Janet with Valgrind'
|
@echo ' make valgrind Assess Janet with Valgrind'
|
||||||
@echo ' make callgrind Assess Janet with Valgrind, using Callgrind'
|
@echo ' make callgrind Assess Janet with Valgrind, using Callgrind'
|
||||||
@echo ' make valtest Run the test suite with Valgrind to check for memory leaks'
|
@echo ' make valtest Run the test suite and examples with Valgrind to check for memory leaks'
|
||||||
|
@echo ' make calltest Run the test suite and examples with Callgrind'
|
||||||
@echo ' make dist Create a distribution tarball'
|
@echo ' make dist Create a distribution tarball'
|
||||||
@echo ' make docs Generate documentation'
|
@echo ' make docs Generate documentation'
|
||||||
@echo ' make debug Run janet with GDB or LLDB'
|
@echo ' make debug Run janet with GDB or LLDB'
|
||||||
@@ -437,6 +441,9 @@ help:
|
|||||||
@echo " make format Format Janet's own source files"
|
@echo " make format Format Janet's own source files"
|
||||||
@echo ' make grammar Generate a TextMate language grammar'
|
@echo ' make grammar Generate a TextMate language grammar'
|
||||||
@echo
|
@echo
|
||||||
|
@echo ' make install-jpm-git Install jpm into the current filesystem'
|
||||||
|
@echo ' make install-spork-git Install spork into the current filesystem'
|
||||||
|
@echo
|
||||||
|
|
||||||
.PHONY: clean install repl debug valgrind test \
|
.PHONY: clean install install-jpm-git install-spork-git repl debug valgrind test \
|
||||||
valtest dist uninstall docs grammar format help compile-commands
|
valtest callgrind callgrind-test dist uninstall docs grammar format help compile-commands
|
||||||
|
|||||||
@@ -4934,14 +4934,15 @@
|
|||||||
"src/core/wrap.c"])
|
"src/core/wrap.c"])
|
||||||
|
|
||||||
# Print janet.c to stdout
|
# Print janet.c to stdout
|
||||||
(print "/* Amalgamated build - DO NOT EDIT */")
|
(def image-only (has-value? boot/args "image-only"))
|
||||||
|
(print "/* " (if image-only "Image-only" "Amalgamated") " build - DO NOT EDIT */")
|
||||||
(print "/* Generated from janet version " janet/version "-" janet/build " */")
|
(print "/* Generated from janet version " janet/version "-" janet/build " */")
|
||||||
(print "#define JANET_BUILD \"" janet/build "\"")
|
(print "#define JANET_BUILD \"" janet/build "\"")
|
||||||
(print ```#define JANET_AMALG```)
|
(print ```#define JANET_AMALG```)
|
||||||
|
|
||||||
(defn do-one-file
|
(defn do-one-file
|
||||||
[fname]
|
[fname]
|
||||||
(unless (has-value? boot/args "image-only")
|
(unless image-only
|
||||||
(print "\n/* " fname " */")
|
(print "\n/* " fname " */")
|
||||||
(print "#line 0 \"" fname "\"\n")
|
(print "#line 0 \"" fname "\"\n")
|
||||||
(def source (slurp fname))
|
(def source (slurp fname))
|
||||||
|
|||||||
Reference in New Issue
Block a user