From ff8142e678995631783e75602d71b9a01c174efa Mon Sep 17 00:00:00 2001 From: saundersp Date: Sat, 27 Apr 2024 20:50:08 +0200 Subject: [PATCH] Makefiles : python and cpp will not start without data downloaded by downloader first --- cpp/Makefile | 5 +++-- python/Makefile | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cpp/Makefile b/cpp/Makefile index c8a976e..85184f6 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -9,9 +9,10 @@ SRC_DIR := . #CFLAGS := $(CFLAGS) -Xptxas=-w #CFLAGS := $(CFLAGS) -Xcompiler -Wall,-O0,-g,-Werror,-Werror=implicit-fallthrough=0,-Wextra,-rdynamic CFLAGS := -O4 -Xcompiler -O4 +DATA_PATH := ../data EXEC := $(OBJ_DIR)/ViolaJones -DATA := ../data/X_train.bin ../data/X_test.bin ../data/y_train.bin ../data/y_test.bin SRC := $(shell find $(SRC_DIR) -name "*.cpp" -o -name "*.cu" ) +DATA := $(DATA_PATH)/X_train.bin $(DATA_PATH)/X_test.bin $(DATA_PATH)/y_train.bin $(DATA_PATH)/y_test.bin OBJ_EXT := o ifeq ($(OS), Windows_NT) EXEC:=$(EXEC).exe @@ -39,7 +40,7 @@ $(EXEC): $(OBJ) @$(CC) $(CFLAGS) $^ -o $@ $(DATA): - @bash ../download_data.sh .. + @echo 'Missing $(DATA) files, use downloader first' && exit 1 start: $(EXEC) $(DATA) @./$(EXEC) diff --git a/python/Makefile b/python/Makefile index 078e4bd..fdffd52 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,11 +1,12 @@ -DATA := ../data/X_train.bin ../data/X_test.bin ../data/y_train.bin ../data/y_test.bin +DATA_PATH := ../data +DATA := $(DATA_PATH)/X_train.bin $(DATA_PATH)/X_test.bin $(DATA_PATH)/y_train.bin $(DATA_PATH)/y_test.bin .PHONY: all start reset all: ${DATA} -${DATA}: - @bash ../download_data.sh .. +$(DATA): + @echo 'Missing $(DATA) files, use downloader first' && exit 1 venv: @bash -c 'source activate.sh'