-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
105 lines (83 loc) · 2.22 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# SPDX-License-Identifier: GPL-2.0
#
# See the file INSTALL for installation instructions.
prefix = $(HOME)/.local/usr
datarootdir = $(prefix)/share
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
mandir = $(datarootdir)/man
man1dir = $(mandir)/man1
includedir = $(prefix)/include
libdir = $(exec_prefix)/lib
pkgdir = $(libdir)/pkgconfig
export prefix includedir libdir
ifdef BUILD_COMPILE
BUILD_CC = $(BUILD_COMPILE)gcc
else
BUILD_CC = $(CC)
endif
ifdef HOST_COMPILE
HOST_CC = $(HOST_COMPILE)gcc
HOST_AR = $(HOST_COMPILE)ar
else
HOST_CC = $(CC)
HOST_AR = $(AR)
endif
ifdef TARGET_COMPILE
TARGET_CC = $(TARGET_COMPILE)gcc
TARGET_LD = $(TARGET_COMPILE)ld
TARGET_AR = $(TARGET_COMPILE)ar
endif
CFLAGS = -g
BUILD_CFLAGS = $(CFLAGS)
HOST_CFLAGS = $(CFLAGS)
TARGET_CFLAGS = $(CFLAGS)
INSTALL = install
XXD = xxd
export XXD
ifeq (1,$(S))
S_CFLAGS = -fsanitize=address -fsanitize=leak -fsanitize=undefined \
-fsanitize-address-use-after-scope
endif
DEP_CFLAGS = -Wp,-MD,$(@D)/$(@F).d -MT $(@D)/$(@F)
BASIC_CFLAGS = -O2 -Wall -D_GNU_SOURCE $(HAVE_CFLAGS) $(DEP_CFLAGS)
BASIC_BUILD_CFLAGS = -Iinclude $(S_CFLAGS) $(BASIC_CFLAGS)
BASIC_HOST_CFLAGS = -Iinclude $(S_CFLAGS) $(BASIC_CFLAGS)
BASIC_TARGET_CFLAGS = -Iinclude $(BASIC_CFLAGS)
.PHONY: all
all:
include doc/Makefile
include lib/Makefile
include system/Makefile
ALL_DEP = $(sort $(ALL_OBJ:%=%.d))
all: $(PSGPLAY)
all: $(LIBPSGPLAY_STATIC) $(LIBPSGPLAY_SHARED) $(LIBPSGPLAY_PC)
all: $(EXAMPLE_INFO) $(EXAMPLE_PLAY)
ifdef TARGET_CC
all: $(PSGPLAY_TOS)
endif
.PHONY: install
install: install-psgplay install-man install-lib
.PHONY: test
test: test-m68kdt
.PHONY: version
version:
@script/version
.PHONY: gtags
gtags:
$(QUIET_GEN)gtags
OTHER_CLEAN += GPATH GRTAGS GTAGS
.PHONY: clean
clean:
$(QUIET_RM)$(RM) $(ALL_OBJ) $(ALL_DEP) $(OTHER_CLEAN)
V = @
Q = $(V:1=)
QUIET_AR = $(Q:@=@echo ' AR '$@;)
QUIET_AS = $(Q:@=@echo ' AS '$@;)
QUIET_CC = $(Q:@=@echo ' CC '$@;)
QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
QUIET_LINK = $(Q:@=@echo ' LD '$@;)
QUIET_RM = $(Q:@=@echo ' RM '$@;)
QUIET_CHECK = $(Q:@=@echo ' CHECK '$@;)
QUIET_TEST = $(Q:@=@echo ' TEST '$@;)
$(eval -include $(ALL_DEP))