-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (57 loc) · 984 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.DEFAULT_GOAL := all
ifeq ($(OS),Windows_NT)
CC := cl
CXX := cl
LD := link
MSVCLNK := lib
RM := cmd /c del /s
ISCC := iscc
else
CC ?= gcc
CXX ?= g++
LD := $(CC)
RM := rm -f
endif
TAR := tar
include build-aux/toolchain.mk
TARGETS =
LIBS =
GARBADGES =
ifdef cc_msvc
CFLAGS += /TC /Wall /WX /wd5045 /wd4820 /D_CRT_SECURE_NO_WARNINGS /Za /Ilib
CXXFLAGS += /Ilib
else
CFLAGS += -Wall -Werror -Wextra -Ilib
CXXFLAGS += -Ilib
ifdef cc_clang_gcc
CFLAGS += -ansi -pedantic
endif
endif
ifdef ld_msvc
LDFLAGS += /SUBSYSTEM:CONSOLE
endif
include lib/build.mk
include mkiso/build.mk
include mkdisk/build.mk
include mngdisk/build.mk
include check/build.mk
.PHONY: all
all: $(TARGETS)
$(TARGETS): $(LIBS)
%.obj: %.c
ifdef cc_msvc
$(CC) /Fo:$@ /c $< $(CFLAGS)
else
$(CC) -o $@ -c $< $(CFLAGS)
endif
%.obj: %.cpp
ifdef cc_msvc
$(CXX) /Fo:$@ /c $< $(CXXFLAGS)
else
$(CXX) -o $@ -c $< $(CXXFLAGS)
endif
.PHONY: dist
dist:
.PHONY: clean
clean:
$(RM) $(GARBADGES) $(TARGETS) $(LIBS)