forked from OpenCAPI/libocxl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.rules
45 lines (35 loc) · 1.17 KB
/
Makefile.rules
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
45
# Basic makefile rules
PREFIX ?= /usr/local
ifdef V
VERBOSE:= $(V)
else
VERBOSE:= 0
endif
ifeq ($(VERBOSE),1)
define Q
$(2)
endef
else
define Q
@/bin/echo -e " [$1]\t$(3)"
@$(2)
endef
endif
obj/%.o : src/%.c src/include/libocxl.h src/libocxl_internal.h src/libocxl_info.h | obj
$(call Q,CC, $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<, $@)
testobj/%.o : src/%.c src/include/libocxl.h src/libocxl_internal.h src/libocxl_info.h | testobj
$(call Q,CC, $(CC) $(CPPFLAGS) $(TESTCFLAGS) -c -o $@ $<, $@)
testobj/%.o-test : unittests/%.c testobj/libocxl.a | testobj
$(call Q,CC, $(CC) $(CPPFLAGS) $(TESTCFLAGS) -c -o $@ $<, $@)
sampleobj/%.o-memcpy : samples/memcpy/%.c obj/libocxl.a | sampleobj
$(call Q,CC, $(CC) $(CPPFLAGS) $(SAMPLECFLAGS) -c -o $@ $<, $@)
afuobj/%.o-memcpy : afutests/memcpy/%.c obj/libocxl.a | afuobj
$(call Q,CC, $(CC) $(CPPFLAGS) $(AFUTESTCFLAGS) -c -o $@ $<, $@)
afuobj/%.o-afp : afutests/afp/%.c obj/libocxl.a | afuobj
$(call Q,CC, $(CC) $(CPPFLAGS) $(AFUTESTCFLAGS) -c -o $@ $<, $@)
datadir ?= $(PREFIX)/share
includedir ?= $(PREFIX)/include
mandir ?= $(datadir)/man
docdir ?= $(datadir)/doc
libdir ?= $(PREFIX)/lib64
INSTALL ?= install -p