aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-05-31 21:21:23 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-05-31 21:21:23 -0400
commit23f14a87adac16acf9ee8bc1df2e6cd025ef86e3 (patch)
tree72405f1f2a7add43edb10bc03fb8931d22be63d3 /Makefile
parent75d919eee490fa28827c5a453aca196496c57d4b (diff)
clean up build processrefactor
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 17 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index ab3a6e2..6b6381d 100644
--- a/Makefile
+++ b/Makefile
@@ -4,50 +4,47 @@ CC = gcc
CXX = g++
ifeq ($(TARGET_OS),linux)
- LIBS = -Llib -lgif -llua5.3 -lentityx -lpthread -lGL -lGLEW -lfreetype \
+ LIBS = -Lentityx -lgif -llua5.3 -lentityx -lpthread -lGL -lGLEW -lfreetype \
-lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2main
endif
ifeq ($(TARGET_OS),win32)
- LIBS = -Llib -lgif -llua -lentityx -lopengl32 -lglew32 -lmingw32 \
+ LIBS = -Lentityx -lgif -llua -lentityx -lopengl32 -lglew32 -lmingw32 \
-lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
endif
-CXXFLAGS = -ggdb -m$(TARGET_BITS) -std=c++17 -fext-numeric-literals
-CXXINC = -Iinclude -Iinclude/freetype -I.
-CXXWARN = -Wall -Wextra -Werror -pedantic
+CXXFLAGS = -O0 -g3 -ggdb -m$(TARGET_BITS) -std=c++20 \
+ -Wall -Wextra -Werror -pedantic \
+ -I. -Iinclude -Iinclude/freetype
CXXSRCDIR = src
CXXOUTDIR = out
CXXSRC = $(wildcard $(CXXSRCDIR)/*.cpp) \
$(wildcard $(CXXSRCDIR)/systems/*.cpp) \
$(wildcard $(CXXSRCDIR)/components/*.cpp)
-CXXOBJ = $(patsubst $(CXXSRCDIR)/%.cpp, $(CXXOUTDIR)/%.o, $(CXXSRC)) \
- $(patsubst $(CXXSRCDIR)/systems/%.cpp, $(CXXOUTDIR)/systems/%.o, $(CXXSRC)) \
- $(patsubst $(CXXSRCDIR)/components/%.cpp, $(CXXOUTDIR)/components/%.o, $(CXXSRC))
+CXXOBJ = $(patsubst $(CXXSRCDIR)/%.cpp, $(CXXOUTDIR)/%.o, \
+ $(patsubst $(CXXSRCDIR)/systems/%.cpp, $(CXXOUTDIR)/systems/%.o, \
+ $(patsubst $(CXXSRCDIR)/components/%.cpp, $(CXXOUTDIR)/components/%.o, $(CXXSRC))))
EXEC = main
-all: SPECIAL:=-ggdb game
-
-game: $(EXEC)
+all: $(EXEC)
clean:
@echo " CLEAN"
@rm -f $(EXEC)
@rm -rf out
- @mkdir out
- @mkdir out/systems
- @mkdir out/components
@rm -f xml/*.dat
-$(EXEC): $(CXXOUTDIR)/$(CXXOBJ)
+$(EXEC): $(CXXOUTDIR) $(CXXOBJ)
@echo " CXX/LD main"
- @$(CXX) $(SPECIAL) $(CXXFLAGS) $(CXXINC) $(CXXWARN) -o $(EXEC) out/components/*.o out/systems/*.o out/*.o $(LIBS)
+ @$(CXX) $(CXXFLAGS) -o $(EXEC) $(CXXOBJ) $(LIBS)
+
+$(CXXOUTDIR):
+ @mkdir out
+ @mkdir out/systems
+ @mkdir out/components
$(CXXOUTDIR)/%.o: $(CXXSRCDIR)/%.cpp
@echo " CXX " $<
- @$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) $(LIBS) -c $< -o $@
+ @$(CXX) $(CXXFLAGS) -c $< -o $@
-$(CXXOUTDIR)/%.o: $(CXXSRCDIR)/%.cc
- @echo " CXX " $<
- @$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) $(LIBS) -c $< -o $@