Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 8c6c866

Browse files
committed
build system cleanups
Make everything consistent. Make it work on hipcc not installed in /opt, i.e. on Debian with Debian packages. Properly use condition, #!, and other factors. Remove code that does nothing. Add .gitignores as needed.
1 parent ff81239 commit 8c6c866

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+348
-758
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BinomialOption
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
HIP_PATH?= $(wildcard /opt/rocm)
22
HIPCC=$(HIP_PATH)/bin/hipcc
33

4-
SOURCES = BinomialOption.cpp
5-
OBJECTS = $(SOURCES:.cpp=.o)
6-
7-
EXECUTABLE=./BinomialOption
4+
BinomialOption: BinomialOption.cpp ../include/HIPUtil.hpp ../include/SDKUtil.hpp
5+
$(HIPCC) -o $@ BinomialOption.cpp
86

97
.PHONY: test
8+
test: BinomialOption
9+
$(shell pwd)/BinomialOption
1010

11-
12-
all: $(EXECUTABLE) test
13-
14-
CXXFLAGS =-g
15-
CXX=$(HIPCC)
16-
17-
18-
$(EXECUTABLE): $(OBJECTS)
19-
$(HIPCC) $(OBJECTS) -o $@
20-
21-
22-
test: $(EXECUTABLE)
23-
$(EXECUTABLE)
24-
25-
11+
.PHONY: clean
2612
clean:
27-
rm -f $(EXECUTABLE)
28-
rm -f $(OBJECTS)
29-
rm -f $(HIP_PATH)/src/*.o
13+
rm -vf BinomialOption *.o
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BitonicSort
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
HIP_PATH?= $(wildcard /opt/rocm)
22
HIPCC=$(HIP_PATH)/bin/hipcc
33

4-
SOURCES = BitonicSort.cpp
5-
OBJECTS = $(SOURCES:.cpp=.o)
6-
7-
EXECUTABLE=./BitonicSort
4+
BitonicSort: BitonicSort.cpp ../include/HIPUtil.hpp ../include/SDKUtil.hpp
5+
$(HIPCC) -o $@ BitonicSort.cpp
86

97
.PHONY: test
8+
test: BitonicSort
9+
$(shell pwd)/BitonicSort
1010

11-
12-
all: $(EXECUTABLE) test
13-
14-
CXXFLAGS =-g
15-
CXX=$(HIPCC)
16-
17-
18-
$(EXECUTABLE): $(OBJECTS)
19-
$(HIPCC) $(OBJECTS) -o $@
20-
21-
22-
test: $(EXECUTABLE)
23-
$(EXECUTABLE)
24-
25-
11+
.PHONY: clean
2612
clean:
27-
rm -f $(EXECUTABLE)
28-
rm -f $(OBJECTS)
29-
rm -f $(HIP_PATH)/src/*.o
13+
rm -vf BitonicSort *.o
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FastWalshTransform
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
HIP_PATH?= $(wildcard /opt/rocm)
22
HIPCC=$(HIP_PATH)/bin/hipcc
33

4-
SOURCES = FastWalshTransform.cpp
5-
OBJECTS = $(SOURCES:.cpp=.o)
6-
7-
EXECUTABLE=./FastWalshTransform
4+
FastWalshTransform: FastWalshTransform.cpp ../include/HIPUtil.hpp ../include/SDKUtil.hpp
5+
$(HIPCC) -o $@ FastWalshTransform.cpp
86

97
.PHONY: test
8+
test: FastWalshTransform
9+
$(shell pwd)/FastWalshTransform
1010

11-
12-
all: $(EXECUTABLE) test
13-
14-
CXXFLAGS =-g
15-
CXX=$(HIPCC)
16-
17-
18-
$(EXECUTABLE): $(OBJECTS)
19-
$(HIPCC) $(OBJECTS) -o $@
20-
21-
22-
test: $(EXECUTABLE)
23-
$(EXECUTABLE)
24-
25-
11+
.PHONY: clean
2612
clean:
27-
rm -f $(EXECUTABLE)
28-
rm -f $(OBJECTS)
29-
rm -f $(HIP_PATH)/src/*.o
13+
rm -vf FastWalshTransform *.o
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FloydWarshall
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
HIP_PATH?= $(wildcard /opt/rocm)
22
HIPCC=$(HIP_PATH)/bin/hipcc
33

4-
SOURCES = FloydWarshall.cpp
5-
OBJECTS = $(SOURCES:.cpp=.o)
6-
7-
EXECUTABLE=./FloydWarshall
4+
FloydWarshall: FloydWarshall.cpp ../include/HIPUtil.hpp ../include/SDKUtil.hpp
5+
$(HIPCC) -o $@ FloydWarshall.cpp
86

97
.PHONY: test
8+
test: FloydWarshall
9+
$(shell pwd)/FloydWarshall
1010

11-
12-
all: $(EXECUTABLE) test
13-
14-
CXXFLAGS =-g
15-
CXX=$(HIPCC)
16-
17-
18-
$(EXECUTABLE): $(OBJECTS)
19-
$(HIPCC) $(OBJECTS) -o $@
20-
21-
22-
test: $(EXECUTABLE)
23-
$(EXECUTABLE)
24-
25-
11+
.PHONY: clean
2612
clean:
27-
rm -f $(EXECUTABLE)
28-
rm -f $(OBJECTS)
29-
rm -f $(HIP_PATH)/src/*.o
13+
rm -vf FloydWarshall *.o
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HelloWorld
Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
HIP_PATH?= $(wildcard /opt/rocm)
22
HIPCC=$(HIP_PATH)/bin/hipcc
33

4-
SOURCES = HelloWorld.cpp
5-
OBJECTS = $(SOURCES:.cpp=.o)
6-
7-
EXECUTABLE=./HelloWorld
4+
HelloWorld: HelloWorld.cpp
5+
$(HIPCC) -o $@ HelloWorld.cpp
86

97
.PHONY: test
8+
test: HelloWorld
9+
$(shell pwd)/HelloWorld
1010

11-
12-
all: $(EXECUTABLE) test
13-
14-
CXXFLAGS =-g
15-
CXX=$(HIPCC)
16-
17-
18-
$(EXECUTABLE): $(OBJECTS)
19-
$(HIPCC) $(OBJECTS) -o $@
20-
21-
22-
test: $(EXECUTABLE)
23-
$(EXECUTABLE)
24-
25-
11+
.PHONY: clean
2612
clean:
27-
rm -f $(EXECUTABLE)
28-
rm -f $(OBJECTS)
29-
rm -f $(HIP_PATH)/src/*.o
13+
rm -vf HelloWorld *.o

0 commit comments

Comments
 (0)