nn-testing/Makefile

37 lines
907 B
Makefile
Raw Permalink Normal View History

2023-07-20 22:34:56 +02:00
SRC=src
BUILD=build
CFLAGS=-Wall -g
2024-01-25 19:56:19 +01:00
CLM_SOURCES=$(SRC)/clm.c $(SRC)/clm_util.c $(SRC)/clm_funcs.c
2024-01-24 12:16:17 +01:00
2023-07-20 22:34:56 +02:00
.PHONY: all
2024-02-21 23:45:11 +01:00
all: libclm libclm_cpu libclm_opencl cltest
2024-01-25 19:56:19 +01:00
.PHONY: run_cpu
2024-02-21 23:45:11 +01:00
run_cpu: all
2024-01-25 19:56:19 +01:00
cd $(BUILD) && ./cltest cpu
2023-07-20 22:34:56 +02:00
2024-01-25 19:56:19 +01:00
.PHONY: run_opencl
2024-02-21 23:45:11 +01:00
run_opencl: all
2024-01-25 19:56:19 +01:00
cd $(BUILD) && ./cltest opencl
.PHONY: cltest
cltest: libclm
mkdir -p $(BUILD)
gcc -lOpenCL -lm -Wl,-rpath -Wl,'$$ORIGIN' -L$(BUILD) -lclm $(CFLAGS) -o $(BUILD)/cltest $(SRC)/cltest.c
.PHONY: libclm
libclm:
mkdir -p $(BUILD)
gcc -lOpenCL -lm -Wl,-rpath -Wl,'$$ORIGIN' -shared -fpic $(CFLAGS) -o $(BUILD)/libclm.so $(CLM_SOURCES)
2024-01-25 19:56:19 +01:00
.PHONY: libclm_cpu
libclm_cpu:
mkdir -p $(BUILD)
2024-01-25 19:56:19 +01:00
gcc -lOpenCL -lm -L$(BUILD) -lclm -shared -fpic $(CFLAGS) -o $(BUILD)/libclm_cpu.so $(SRC)/clm_cpu.c
2024-01-25 19:56:19 +01:00
.PHONY: libclm_opencl
libclm_opencl:
mkdir -p $(BUILD)
gcc -lOpenCL -lm -L$(BUILD) -lclm -shared -fpic $(CFLAGS) -o $(BUILD)/libclm_opencl.so $(SRC)/clm_opencl.c