|
4 | 4 | .PHONY: build-ramulator2 build-wrapper clean-ramulator2 clean-wrapper patch-ramulator2 |
5 | 5 |
|
6 | 6 | # Patch target for ramulator2 |
7 | | -patch-ramulator2: 3rd-party/ramulator2/.patch-applied |
8 | | - |
9 | | -# Marker file to track patch application |
10 | | -3rd-party/ramulator2/.patch-applied: |
| 7 | +patch-ramulator2: |
11 | 8 | @echo "Checking ramulator2 patch status..." |
12 | 9 | @cd 3rd-party/ramulator2 && \ |
13 | 10 | if bash ../../scripts/patch-apply.sh check ../../scripts/init/patches/ramulator2.patch 2>/dev/null; then \ |
14 | 11 | echo "Ramulator2 patch already applied — skipping patch step."; \ |
15 | 12 | else \ |
16 | 13 | echo "Applying ramulator2 patch..."; \ |
17 | 14 | bash ../../scripts/patch-apply.sh apply ../../scripts/init/patches/ramulator2.patch; \ |
18 | | - fi && \ |
19 | | - touch $(CURDIR)/3rd-party/ramulator2/.patch-applied |
| 15 | + fi |
20 | 16 |
|
21 | | -build-ramulator2: 3rd-party/ramulator2/.ramulator2-built |
| 17 | +build-ramulator2: patch-ramulator2 3rd-party/ramulator2/.ramulator2-built |
22 | 18 |
|
23 | 19 | # Marker file to track build completion |
24 | | -3rd-party/ramulator2/.ramulator2-built: patch-ramulator2 |
25 | | - @if [ -f "$@" ]; then \ |
| 20 | +3rd-party/ramulator2/.ramulator2-built: |
| 21 | + @if [ -f "$@" ] && ls 3rd-party/ramulator2/libramulator.* >/dev/null 2>&1; then \ |
26 | 22 | echo "Ramulator2 already built — skipping build step."; \ |
27 | 23 | else \ |
28 | | - echo "Building Ramulator2..."; \ |
29 | | - echo "Step 1: Creating build directory..."; \ |
30 | | - mkdir -p 3rd-party/ramulator2/build; \ |
31 | | - echo "Step 2: Running CMake configuration..."; \ |
32 | | - cmake -B 3rd-party/ramulator2/build -S 3rd-party/ramulator2 -DCMAKE_POLICY_VERSION_MINIMUM=3.5; \ |
33 | | - echo "Step 3: Building with make..."; \ |
34 | | - make -C 3rd-party/ramulator2/build -j; \ |
35 | | - echo "Ramulator2 build completed."; \ |
| 24 | + rm -f $(CURDIR)/$@; \ |
| 25 | + echo "Building Ramulator2..." && \ |
| 26 | + echo "Step 1: Creating build directory..." && \ |
| 27 | + mkdir -p 3rd-party/ramulator2/build && \ |
| 28 | + echo "Step 2: Running CMake configuration..." && \ |
| 29 | + cmake -B 3rd-party/ramulator2/build -S 3rd-party/ramulator2 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && \ |
| 30 | + echo "Step 3: Building with make..." && \ |
| 31 | + $(MAKE) -C 3rd-party/ramulator2/build -j && \ |
| 32 | + ls 3rd-party/ramulator2/libramulator.* >/dev/null 2>&1 && \ |
| 33 | + echo "Ramulator2 build completed." && \ |
36 | 34 | touch $(CURDIR)/$@; \ |
37 | 35 | fi |
38 | 36 |
|
39 | 37 | build-wrapper: tools/c-ramulator2-wrapper/.wrapper-built |
40 | 38 |
|
41 | 39 | # Marker file to track wrapper build completion |
42 | 40 | tools/c-ramulator2-wrapper/.wrapper-built: build-ramulator2 |
43 | | - @if [ -f "$@" ]; then \ |
| 41 | + @if [ -f "$@" ] && ls tools/c-ramulator2-wrapper/build/lib/libwrapper.* >/dev/null 2>&1; then \ |
44 | 42 | echo "Wrapper already built — skipping build step."; \ |
45 | 43 | else \ |
46 | | - echo "Building Wrapper..."; \ |
| 44 | + rm -f $(CURDIR)/$@; \ |
| 45 | + echo "Building Wrapper..." && \ |
47 | 46 | mkdir -p tools/c-ramulator2-wrapper/build && \ |
48 | 47 | cd tools/c-ramulator2-wrapper/build && \ |
49 | 48 | cmake .. && \ |
50 | | - make -j; \ |
51 | | - echo "Wrapper build completed."; \ |
| 49 | + $(MAKE) -j && \ |
| 50 | + ls lib/libwrapper.* >/dev/null 2>&1 && \ |
| 51 | + echo "Wrapper build completed." && \ |
52 | 52 | touch $(CURDIR)/$@; \ |
53 | 53 | fi |
54 | 54 |
|
|
0 commit comments