summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 43862c1..3efe726 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,22 @@
CFLAGS=-g
+COMMON_OBJECTS = cl_simple.o util.o
+LDFLAGS = -L/usr/local/lib -lOpenCL
+
+
all: hello_world math-int get-global-id get-global-id-2d loop
-hello_world: hello_world.o util.o
- gcc -o hello_world $^ -L/usr/local/lib/ -lOpenCL
+hello_world: hello_world.o $(COMMON_OBJECTS)
+ gcc -o $@ $^ $(LDFLAGS)
-math-int: math-int.o util.o
- gcc -o math-int $^ -L/usr/local/lib/ -lOpenCL
+math-int: math-int.o $(COMMON_OBJECTS)
+ gcc -o $@ $^ $(LDFLAGS)
-get-global-id: get_global_id.o util.o
- gcc -o get-global-id $^ -L/usr/local/lib/ -lOpenCL
+get-global-id: get_global_id.o $(COMMON_OBJECTS)
+ gcc -o $@ $^ $(LDFLAGS)
-get-global-id-2d: get_global_id_2d.o util.o
- gcc -o $@ $^ -L/usr/local/lib/ -lOpenCL
+get-global-id-2d: get_global_id_2d.o $(COMMON_OBJECTS)
+ gcc -o $@ $^ $(LDFLAGS)
-loop: loop.o util.o
- gcc -o $@ $^ -L/usr/local/lib/ -lOpenCL
+loop: loop.o $(COMMON_OBJECTS)
+ gcc -o $@ $^ $(LDFLAGS)