Files
rocm-systems/projects/hip/samples/0_Intro/bit_extract/Makefile
T

28 lines
640 B
Makefile
Raw Normal View History

2016-01-26 20:14:33 -06:00
#Dependencies : [MYHIP]/bin must be in user's path.
2016-04-18 10:15:35 +05:30
HIP_PATH?= $(wildcard /opt/rocm/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif
2016-01-26 20:14:33 -06:00
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform)
HIPCC=$(HIP_PATH)/bin/hipcc
# Show how to use PLATFORM to specify different options for each compiler:
ifeq (${HIP_PLATFORM}, nvcc)
HIPCC_FLAGS = -gencode=arch=compute_20,code=sm_20
endif
EXE=bit_extract
EXE_STATIC=bit_extract_static
2016-01-26 20:14:33 -06:00
$(EXE): bit_extract.cpp
$(HIPCC) $(HIPCC_FLAGS) $< -o $@
$(EXE_STATIC): bit_extract.cpp
$(HIPCC) -use-staticlib $(HIPCC_FLAGS) $< -o $@
all: $(EXE) $(EXE_STATIC)
2016-01-26 20:14:33 -06:00
clean:
rm -f *.o $(EXE) $(EXE_STATIC)