-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (73 loc) · 2.97 KB
/
Copy pathMakefile
File metadata and controls
86 lines (73 loc) · 2.97 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# JavaCOP Makefile
#
# Usage:
# make run-step1 Run Step 1 (OOP baseline)
# make run-step2 Run Step 2 (COP proxies)
# make run-step3 Run Step 3 (Proceed mechanism)
# make build-profiler Build the profiler agent
# make profile-all Run all steps with profiler
# make clean Remove compiled files
# make help Show this help
.PHONY: help run-step1 run-step2 run-step3 compile-all build-profiler profile-all clean
# Javassist path
JAVASSIST = step4/lib/javassist-3.29.0-GA.jar
# Default target
help:
@echo "JavaCOP - Context-Oriented Programming in Java"
@echo ""
@echo "Usage:"
@echo " make run-step1 Run Step 1 (OOP baseline)"
@echo " make run-step2 Run Step 2 (COP proxies)"
@echo " make run-step3 Run Step 3 (Proceed mechanism)"
@echo " make build-profiler Build the profiler agent JAR"
@echo " make profile-all Run all steps with profiler"
@echo " make clean Remove compiled .class files"
@echo " make help Show this help"
# Run individual steps
run-step1:
@javac step1/Main.java step1/reflection/**/*.java
@java step1.Main
run-step2:
@javac step2/Main.java step2/reflection/**/*.java
@java step2.Main
run-step3:
@javac step3/Main.java step3/reflection/**/*.java
@java step3.Main
# Compile all steps
compile-all:
@echo "Compiling all steps..."
@javac step1/Main.java step1/reflection/**/*.java
@javac step2/Main.java step2/reflection/**/*.java
@javac step3/Main.java step3/reflection/**/*.java
@echo "Done."
# Build profiler agent
build-profiler:
@echo "Building profiler agent..."
@javac -cp .:$(JAVASSIST) step4/ProfilerAgent.java step4/ContextLogger.java
@jar cmf step4/manifest.txt profiler.jar step4/*.class
@echo "Created profiler.jar"
# Run with profiler
profile-step1: compile-all build-profiler
@mkdir -p results_profiler
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step1.txt step1.Main
profile-step2: compile-all build-profiler
@mkdir -p results_profiler
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step2.txt step2.Main
profile-step3: compile-all build-profiler
@mkdir -p results_profiler
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step3.txt step3.Main
profile-all: compile-all build-profiler
@mkdir -p results_profiler
@echo "Profiling Step 1..."
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step1.txt step1.Main > /dev/null
@echo "Profiling Step 2..."
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step2.txt step2.Main > /dev/null
@echo "Profiling Step 3..."
@java -cp .:profiler.jar:$(JAVASSIST) -javaagent:profiler.jar=results_profiler/results_step3.txt step3.Main > /dev/null
@echo "Results saved to results_profiler/"
# Clean compiled files
clean:
@echo "Cleaning compiled files..."
@find . -name "*.class" -type f -delete
@rm -f profiler.jar
@echo "Done."