forked from gibsson/linux-adk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (56 loc) · 1.27 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
V ?= 0
ifeq ($V, 1)
E =
P = @true
else
E = @
P = @echo
endif
SHELL = /bin/sh
srcdir = src
objdir = obj
prefix = $(DESTDIR)/usr/local
exec_prefix = $(DESTDIR)/${prefix}
bindir = $(exec_prefix)/bin
CC = $(CROSS_COMPILE)gcc
INSTALL = install
MKDIR = mkdir -p
LIBS = -lusb-1.0 -lpthread -lSDL -lSDL_image -lts -ljpeg
CFLAGS += -g -O0
LDFLAGS +=
CPPFLAGS +=
ARCH ?= $(ARCH_x86_64)
ARCH_CFLAGS ?= $(CFLAGS_x86_64)
CFLAGS += -Isrc
CFLAGS += -I$(TARGET_SYSROOT)/usr/include
CFLAGS += -I$(TARGET_SYSROOT)/usr/include/libusb-1.0
CFLAGS += -I$(TARGET_SYSROOT)/usr/include/SDL
CFLAGS += -Wall -Wextra -Wno-char-subscripts -Wno-unused-parameter -Wno-format
CFLAGS += $(ARCH_CFLAGS)
OBJ = $(objdir)/accessory.o \
$(objdir)/hid.o \
$(objdir)/linux-adk.o
TARGET = linux-adk
all: $(objdir) $(TARGET)
$(TARGET): $(OBJ)
$P ' LD $@'
$E $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
$(objdir):
$E mkdir $(objdir)
$(objdir)/%.o: $(srcdir)/%.c
$P ' CC $@'
$E $(CC) $(CFLAGS) -c -o $@ $^
.PHONY: clean
clean:
$P ' RM TARGET'
$E rm -f $(TARGET)
$P ' RM OBJS'
$E rm -rf $(objdir)
install:
$P ' MKDIRS '
$E $(MKDIR) $(bindir)
$P ' INSTALL $(TARGET)'
$E $(INSTALL) $(TARGET) $(bindir)
uninstall:
$P ' UNINSTALL'
$E rm -f $(bindir)/$(TARGET)