-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 1.08 KB
/
Makefile
File metadata and controls
36 lines (27 loc) · 1.08 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
# Directory containing CSV files
DIST_DIR = dist
# Directory to store compressed files
MEASUREMENTS_DIR = measurements
# Find all CSV files in the dist directory
CSV_FILES = $(wildcard $(DIST_DIR)/*.csv)
TARGET_XZ_FILES = $(CSV_FILES:$(DIST_DIR)/%.csv=$(MEASUREMENTS_DIR)/%.csv.xz)
# Convert CSV files to .xz files
XZ_FILES = $(wildcard $(MEASUREMENTS_DIR)/*.csv.xz)
TARGET_CSV_FILES = $(XZ_FILES:$(MEASUREMENTS_DIR)/%.csv.xz=$(DIST_DIR)/%.csv)
# Default target
.PHONY: all compress decompress clean
# Compress the CSV files into .xz format (only if not already compressed or outdated)
compress: $(TARGET_XZ_FILES)
# Rule for creating .xz files from .csv files
$(MEASUREMENTS_DIR)/%.csv.xz: $(DIST_DIR)/%.csv
@mkdir -p $(MEASUREMENTS_DIR)
xz -z -k -T0 $< -c > $@
# Decompress the .xz files back to CSV format (only if not already decompressed or outdated)
decompress: $(TARGET_CSV_FILES)
# Rule for decompressing .xz files back to .csv
$(DIST_DIR)/%.csv: $(MEASUREMENTS_DIR)/%.csv.xz
@mkdir -p $(DIST_DIR)
xz -d -k $< -c > $@
# Clean target to remove the compressed files
clean:
rm -f $(XZ_FILES)