-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (45 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
66 lines (45 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.PHONY: all clean test lexspeedtest purge main
# $(filter-out ./psyq/% ./includes/%, $(wildcard **/*.ml **/*.mll **/*.mli))
# Update the 'all' target to compile all files except those from the "psyq" and "includes" folders
all:
dune build
@echo "Build completed!"
clean: # rm -rf /build
@echo "Ryder op..."
dune clean
test: clean
dune runtest
lexspeedtest:
make speedtest EXE="_build/default/src/frontend/lexer/lexer.exe" PSX="code.psx"
speedtest: #EXE to test #PSC path to code for exe arg
source scripts/run_speedtest.bash $(EXE) $(PSX)
purge: #convert bash script notation from dos to unix
dos2unix scripts/run_speedtest.bash
# Define the default target
.PHONY: default
default: run_main
filename := some_value
# Extract the second word from the make command line arguments
second_word = $(word 2,$(MAKECMDGOALS))
# Check if the second word exists and set the filename
ifeq ($(filter main,$(MAKECMDGOALS)),main)
ifneq ($(second_word),)
filename := $(second_word)
endif
endif
# Check if the second word exists and set the filename
ifeq ($(filter int_test,$(MAKECMDGOALS)),int_test)
ifneq ($(second_word),)
filename := $(second_word)
endif
endif
# Define a rule for running main.exe with a given .psx file
main: # run main.exe with a specified .psx file
cd _build/default/src && ./main.exe ../../../compile/input/$(filename) ../../../compile/c_output/
int_test: # run main.exe with a specified .psx file
cd _build/default/src && ./main.exe ../../../test/integration_test/psx_files/$(filename) ../../../test/integration_test/actual_files/
# $(MAKE) -f psyqcompiler filename=$(filename)
# $(MAKE) -f psyqcompiler clean
# Prevent make from interpreting "filename.psx" as a file target
%:
@: