-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.macos
67 lines (54 loc) · 2.08 KB
/
Makefile.macos
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
.PHONY: clean
PLATFORM := $(shell uname -s)
VERSION_TAG := $(shell git describe --always --tags --abbrev=0)
COMMIT_HASH := $(shell git rev-parse --short HEAD)
OS_INFO := $(shell uname -rmo)
EXEC := iris
INCLUDE_DIRS := imgui imgui/backends frontend gl3w/include tomlplusplus/include
OUTPUT_DIR := bin
CXX := g++
CXXFLAGS := $(addprefix -I, $(INCLUDE_DIRS)) -iquote src $(shell sdl2-config --cflags --libs)
CXXFLAGS += -O3 -march=native -mtune=native -flto=auto -Wall -std=c++20
CXXFLAGS += -mmacosx-version-min=10.15 -Wno-newline-eof
CXXFLAGS += -D_IRIS_VERSION="$(VERSION_TAG)"
CXXFLAGS += -D_IRIS_COMMIT="$(COMMIT_HASH)"
CXXFLAGS += -D_IRIS_OSVERSION="$(OS_INFO)"
CXXSRC := $(wildcard imgui/*.cpp)
CXXSRC += $(wildcard imgui/backends/imgui_impl_sdl2.cpp)
CXXSRC += $(wildcard imgui/backends/imgui_impl_opengl3.cpp)
CXXSRC += $(wildcard frontend/platform/stub.cpp)
CXXSRC += $(wildcard frontend/*.cpp)
CXXSRC += $(wildcard frontend/ui/*.cpp)
CXXSRC += $(wildcard src/gs/renderer/*.cpp)
CXXSRC += $(wildcard src/ipu/*.cpp)
CXXSRC += $(wildcard src/iop/hle/*.cpp)
CXXOBJ := $(CXXSRC:.cpp=.o)
CC := gcc
CFLAGS := $(addprefix -I, $(INCLUDE_DIRS)) -iquote src $(shell sdl2-config --cflags --libs)
CFLAGS += -O3 -ffast-math -march=native -mtune=native -pedantic
CFLAGS += -flto=auto -Wall -mmacosx-version-min=10.15 -Wno-newline-eof
CSRC := $(wildcard src/*.c)
CSRC += $(wildcard src/ee/*.c)
CSRC += $(wildcard src/iop/*.c)
CSRC += $(wildcard src/shared/*.c)
CSRC += $(wildcard src/gs/*.c)
CSRC += $(wildcard src/dev/*.c)
CSRC += $(wildcard gl3w/src/*.c)
CSRC += $(wildcard frontend/tfd/*.c)
COBJ := $(CSRC:.c=.o)
ifndef USE_INTRINSICS
CFLAGS += -D_EE_USE_INTRINSICS -mssse3 -msse4
CXXFLAGS += -D_EE_USE_INTRINSICS
endif
all: $(OUTPUT_DIR) $(COBJ) $(CXXOBJ) $(OUTPUT_DIR)/$(EXEC)
$(OUTPUT_DIR):
mkdir -p $(OUTPUT_DIR)
$(COBJ): %.o: %.c
@echo " CC " $<; $(CC) -c $< -o $@ $(CFLAGS)
$(CXXOBJ): %.o: %.cpp
@echo " CXX" $<; $(CXX) -c $< -o $@ $(CXXFLAGS)
$(OUTPUT_DIR)/$(EXEC): $(COBJ) $(CXXOBJ)
$(CXX) $(COBJ) $(CXXOBJ) main.cpp -o $(OUTPUT_DIR)/$(EXEC) $(CXXFLAGS)
clean:
rm -rf $(OUTPUT_DIR)
rm $(COBJ) $(CXXOBJ)