diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2022-05-31 21:21:23 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2022-05-31 21:21:23 -0400 |
commit | 23f14a87adac16acf9ee8bc1df2e6cd025ef86e3 (patch) | |
tree | 72405f1f2a7add43edb10bc03fb8931d22be63d3 /Makefile | |
parent | 75d919eee490fa28827c5a453aca196496c57d4b (diff) |
clean up build processrefactor
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 17 insertions, 20 deletions
@@ -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 $@ |