Files
OpenCL-examples/Makefile-04
2015-08-03 16:01:08 -04:00

34 lines
848 B
Plaintext

CXX = gcc
# clFFT lib & inc
CLFFT_LIB = -lOpenCL -L./clFFT/build/package/lib64 -lclFFT
CLFFT_INCLUDE = -I./clFFT/build/package/include
# standard math library
CXXFLAGS = -c $(CLFFT_INCLUDE)
LDFLAGS = -lm $(CLFFT_LIB)
EXE = Example04
all: $(EXE)
compile: example04/build/main.o
# entire process
$(EXE): example04/build/main.o
@if [ ! -d "./example04/bin" ]; then mkdir ./example04/bin; fi
$(CXX) $< $(LDFLAGS) -o example04/bin/$@
# link only
link:
@if [ ! -d "./example04/bin" ]; then mkdir ./example04/bin; fi
$(CXX) $< $(LDFLAGS) -o example04/bin/$@
# create object file (compile without linking)
example04/build/main.o: example04/main.c
@if [ ! -d "./example04/build" ]; then mkdir ./example04/build; fi
$(CXX) $(CXXFLAGS) $< -o $@
# cleaning (remove executables and what not)
clean:
$(RM) -r ./example04/build/ ./example04/bin/