-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
55 lines (43 loc) · 1003 Bytes
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
.SUFFIXES:
.DEFAULT:
.EXTRA_PREREQS += Makefile
MAKEFLAGS += -r --no-print-directory
all: enum dumbkms
BUILDDIR ?= build
CC ?= cc
CFLAGS += -Wall -Wextra -Werror -pedantic
CFLAGS += -std=gnu99 -I/usr/include/libdrm
LIBS += -ldrm
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -ggdb3
else
CFLAGS += -O3
endif
DEPFLAGS = -MMD -MP
COMPILE.c = $(CC) $(CFLAGS) $(DEPFLAGS) -MT $@ -MF [email protected]
OBJDIR ?= $(BUILDDIR)/obj
$(OBJDIR)/%.c.o: %.c
@mkdir -p $(dir $@)
$(COMPILE.c) -c $< -o $@
SOURCES = \
enum.c \
dumbkms.c \
#kmsgrab.c \
#drmsend.c \
OBJS = $(SOURCES:%=$(OBJDIR)/%.o)
DEPS = $(OBJS:%=%.d)
-include $(DEPS)
enum: $(BUILDDIR)/enum
dumbkms: $(BUILDDIR)/dumbkms
#drmsend: $(BUILDDIR)/drmsend
#kmsgrab: $(BUILDDIR)/kmsgrab
$(BUILDDIR)/%: $(OBJDIR)/%.c.o
@mkdir -p $(dir $@)
$(CC) $^ $(LIBS) -o $@
#$(BUILDDIR)/kmsgrab: $(OBJDIR)/kmsgrab.c.o
# @mkdir -p $(dir $@)
# $(CC) $^ $(LIBS) -lEGL -lX11 -o $@
#
#$(BUILDDIR)/drmsend: $(OBJDIR)/%.c.o
# @mkdir -p $(dir $@)
# $(CC) $^ $(LIBS) -lEGL -lX11 -o $@