26 lines
503 B
Makefile
26 lines
503 B
Makefile
SRC=src
|
|
BUILD=build
|
|
CFLAGS=-Wall -g
|
|
|
|
CLM_SOURCES=$(SRC)/clm.c $(SRC)/clm_util.c
|
|
CLM_SOURCES_CPU=$(CLM_SOURCES) $(SRC)/clm_gpu_cpu.c
|
|
CLM_SOURCES_OPENCL=$(CLM_SOURCES) $(SRC)/clm_gpu_opencl.c
|
|
|
|
.PHONY: all
|
|
all:
|
|
mkdir -p $(BUILD)
|
|
gcc -lOpenCL -lm $(CFLAGS) -o $(BUILD)/cltest $(SRC)/cltest.c $(CLM_SOURCES_OPENCL)
|
|
|
|
.PHONY: run
|
|
run: all
|
|
$(BUILD)/cltest
|
|
|
|
.PHONY: cl
|
|
cl:
|
|
mkdir -p $(BUILD)
|
|
gcc -lOpenCL -lm $(CFLAGS) -o $(BUILD)/cl $(SRC)/cl.c $(CLM_SOURCES_OPENCL)
|
|
|
|
.PHONY: cl_run
|
|
cl_run: cl
|
|
$(BUILD)/cl
|