Mercurial > hg > Game > Cerium
annotate example/Cuda/Makefile @ 2067:0e2389a5ac4e draft
fix Cudaexmple
author | ikkun |
---|---|
date | Fri, 03 Feb 2017 19:09:16 +0900 |
parents | 4d1bc8cd3a62 |
children | 26aa08c9a1de |
rev | line source |
---|---|
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 include ./Makefile.def |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 SRCS_TMP = $(wildcard *.cc) |
1919
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
4 SRCS_EXCLUDE = # 除外するファイルを書く |
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 OBJS = $(SRCS:.cc=.o) |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 |
1919
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
8 CUDA_SRCS_TMP = $(wildcard *.cu) |
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
9 CUDA_SRCS_EXCLUDE = # 除外するファイルを書く |
1920 | 10 CUDA_SRCS = $(filter-out $(CUDA_SRCS_EXCLUDE),$(CUDA_SRCS_TMP)) |
11 CUDA_OBJS = $(CUDA_SRCS:.cu=.ptx) | |
1919
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
12 |
1920 | 13 CC += $(ABI) |
1919
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
14 |
1920 | 15 LIBS = -F/Library/Frameworks -framework CUDA |
2005
4d1bc8cd3a62
fix Makefile(CUDA PATH)
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1969
diff
changeset
|
16 INCLUDE = -I$(CUDA_PATH) |
1919
d6e033734c12
running cuda sample
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1918
diff
changeset
|
17 |
1969
a68dbdf9b429
fix GpuScheduler
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1927
diff
changeset
|
18 .SUFFIXES: .cc .o .cu .ptx |
1920 | 19 .cc.o: |
20 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ | |
1969
a68dbdf9b429
fix GpuScheduler
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1927
diff
changeset
|
21 .cu.ptx: |
a68dbdf9b429
fix GpuScheduler
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1927
diff
changeset
|
22 $(NVCC) $(NVCCFLAGS) $< |
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 all: $(TARGET) |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 |
1969
a68dbdf9b429
fix GpuScheduler
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1927
diff
changeset
|
26 $(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) |
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 link: |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 debug: $(TARGET) |
2067 | 33 sudo lldb ./$(TARGET) |
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 |
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 clean: |
1920 | 36 rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) |
1918
15e8c50ed570
add cuda sample, not running
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 rm -f *~ \#* |