-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile.os4
More file actions
41 lines (31 loc) · 773 Bytes
/
makefile.os4
File metadata and controls
41 lines (31 loc) · 773 Bytes
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
LIBS = -lSDL3
OWN_PATHS = -I.
HEADERS = $(OWN_PATHS) -I/SDK/local/newlib/include
DEFINES =
CFLAGS = -std=c++20 -Wall -Wextra -O3 -gstabs
NAME = opengw
OBJDIR = obj
ALL_SRC = $(wildcard *.cpp)
SRC_FILES = $(notdir $(ALL_SRC))
OBJ_FILES = $(SRC_FILES:.cpp=.o)
OBJS = $(addprefix $(OBJDIR)/, $(OBJ_FILES))
DEPS = $(OBJS:.o=.d)
COMPILER = g++
all: $(NAME)
#$(NAME)
# dependencies
$(OBJDIR)/%.d : %.cpp | $(OBJDIR)
$(COMPILER) -MM -MP -MT $(@:.d=.o) -o $@ $< $(CFLAGS) $(DEFINES) $(HEADERS)
# compiling
$(OBJDIR)/%.o : %.cpp
$(COMPILER) -o $@ -c $< $(CFLAGS) $(DEFINES) $(HEADERS)
clean:
rm $(OBJDIR)/*
$(NAME): $(OBJS)
$(COMPILER) -o $@ $(OBJS) $(LIBS) -athread=native
$(OBJDIR):
mkdir -p $@
# Load .d files
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPS)
endif