31 lines
873 B
Makefile
31 lines
873 B
Makefile
.PHONY: all watch-openmp clean
|
|
|
|
CFLAGS := -std=c11 -fopenmp=libomp -I/opt/homebrew/opt/libomp/include
|
|
LDFLAGS := -std=c11 -fopenmp=libomp -L/opt/homebrew/opt/libomp/lib
|
|
RUST_SOURCES := $(shell find . -name "*.rs")
|
|
|
|
all: lc_openmp lc_pthreads
|
|
|
|
clean:
|
|
rm -rf lc_openmp lc_pthreads zhan4854 zhan4854.tar.gz *.o
|
|
|
|
zhan4854.tar.gz: common.c common.h lc_openmp.c lc_pthreads.c Makefile
|
|
mkdir -p zhan4854
|
|
mv $^ zhan4854
|
|
tar -czvf $@ zhan4854
|
|
rm -r zhan4854
|
|
|
|
watch-openmp:
|
|
watchexec -c clear -e Makefile,c,h 'make lc_openmp && ./lc_openmp ./dataset/small_data.csv ./dataset/small_label.csv 10 2'
|
|
|
|
lc_openmp: lc_openmp.o common.o
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
|
|
|
lc_pthreads: lc_pthreads.o common.o
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
rust: $(RUST_SOURCES)
|
|
cargo run -- ${BASE_PATH}/dataset/{small_data.csv,small_label.csv} 10 2
|