Files
rocm-systems/samples/0_Intro/square/Makefile
T
Maneesh Gupta b3fb8ea92f Simplify square sample's Makefile
Change-Id: I44349a880a3c57ca0e833d67d9c380b706655b1e
2017-12-05 11:54:50 +05:30

25 baris
447 B
Makefile

HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform)
HIPCC=$(HIP_PATH)/bin/hipcc
ifeq (${HIP_PLATFORM}, nvcc)
SOURCES=square.cu
else
SOURCES=square.cpp
endif
all: square.out
# Step
square.cpp: square.cu
$(HIP_PATH)/bin/hipify-perl square.cu > square.cpp
square.out: $(SOURCES)
$(HIPCC) $(CXXFLAGS) $(SOURCES) -o $@
clean:
rm -f *.o *.out square.cpp