-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 735 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CC=gcc
CFLAGS=-I$(SDIR) -L$(SDIR)
BDIR=.
SDIR=src/
IDIR=$(SDIR)
LDIR=$(SDIR)
MKDIR_P = mkdir -p
ifdef OS
RM=cmd //C del //Q
RSYNC=cmd //C copy //V
FixPath = $(subst /,\,$1)
else
RM=rm -f
RSYNC=rsync -rupE
FixPath = $1
endif
LIBS=-lm -lOpenCL
_DEPS = main.h worker.h common.h assert.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = main.o worker.o assert.o
OBJ = $(patsubst %,$(SDIR)/%,$(_OBJ))
$(SDIR)/%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: all mkdirs copycl clean
all: mkdirs cln22 copycl clean
cln22: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
mkdirs:
$(MKDIR_P) $(BDIR)/work
$(MKDIR_P) $(BDIR)/log
copycl:
$(RSYNC) $(call FixPath,$(SDIR)/kernel22.cl $(BDIR))
clean:
$(RM) $(call FixPath,$(SDIR)/*.o)