Skip to content

Commit

Permalink
Make
Browse files Browse the repository at this point in the history
  • Loading branch information
Jukitsu committed Dec 16, 2023
1 parent 5f9fc30 commit ad45d9e
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 241 deletions.
284 changes: 146 additions & 138 deletions Jukcraft/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GNU Make project makefile autogenerated by Premake
# Alternative GNU Make project makefile autogenerated by Premake

ifndef config
config=debug
Expand All @@ -8,130 +8,126 @@ ifndef verbose
SILENT = @
endif

.PHONY: clean prebuild prelink

ifeq ($(config),debug)
RESCOMP = windres
TARGETDIR = ../bin/Debug-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Debug-windows-Jukcraft
PCH = src/pch.h
GCH = $(OBJDIR)/$(notdir $(PCH)).gch
DEFINES += -DGLFW_INCLUDE_NONE
INCLUDES += -Isrc -I../vendor/glad/include -I../vendor/glfw/include -I../vendor/glm -I../vendor/stb -I../vendor/spdlog/include
FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -std=c++17
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LIBS += ../bin/Debug-windows/GLFW/GLFW.lib ../bin/Debug-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Debug-windows/GLFW/GLFW.lib ../bin/Debug-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
all: prebuild prelink $(TARGET)
@:
.PHONY: clean prebuild

SHELLTYPE := posix
ifeq (.exe,$(findstring .exe,$(ComSpec)))
SHELLTYPE := msdos
endif

ifeq ($(config),beta)
RESCOMP = windres
TARGETDIR = ../bin/Beta-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Beta-windows-Jukcraft
PCH = src/pch.h
GCH = $(OBJDIR)/$(notdir $(PCH)).gch
DEFINES += -DGLFW_INCLUDE_NONE -DGLM_FORCE_INLINE
INCLUDES += -Isrc -I../vendor/glad/include -I../vendor/glfw/include -I../vendor/glm -I../vendor/stb -I../vendor/spdlog/include
FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -ffast-math -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -ffast-math -O2 -std=c++17
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LIBS += ../bin/Beta-windows/GLFW/GLFW.lib ../bin/Beta-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Beta-windows/GLFW/GLFW.lib ../bin/Beta-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
all: prebuild prelink $(TARGET)
@:

endif
# Configurations
# #############################################

RESCOMP = windres
PCH = src/pch.h
PCH_PLACEHOLDER = $(OBJDIR)/$(notdir $(PCH))
GCH = $(PCH_PLACEHOLDER).gch
INCLUDES += -Isrc -I../vendor/glad/include -I../vendor/glfw/include -I../vendor/glm -I../vendor/stb -I../vendor/spdlog/include
FORCE_INCLUDE +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef

ifeq ($(config),release)
RESCOMP = windres
TARGETDIR = ../bin/Release-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Release-windows-Jukcraft
PCH = src/pch.h
GCH = $(OBJDIR)/$(notdir $(PCH)).gch
DEFINES += -DGLFW_INCLUDE_NONE -DGLM_FORCE_INLINE -DSPDLOG_NO_EXCEPTIONS
INCLUDES += -Isrc -I../vendor/glad/include -I../vendor/glfw/include -I../vendor/glm -I../vendor/stb -I../vendor/spdlog/include
FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -ffast-math -fomit-frame-pointer -O3
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -ffast-math -fomit-frame-pointer -O3 -std=c++17 -fno-exceptions -fno-rtti
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LIBS += ../bin/Release-windows/GLFW/GLFW.lib ../bin/Release-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Release-windows/GLFW/GLFW.lib ../bin/Release-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto -s
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
all: prebuild prelink $(TARGET)
@:
ifeq ($(config),debug)
TARGETDIR = ../bin/Debug-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Debug-windows-Jukcraft
DEFINES += -DGLFW_INCLUDE_NONE
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -std=c++17
LIBS += ../bin/Debug-windows/GLFW/GLFW.lib ../bin/Debug-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Debug-windows/GLFW/GLFW.lib ../bin/Debug-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64

else ifeq ($(config),beta)
TARGETDIR = ../bin/Beta-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Beta-windows-Jukcraft
DEFINES += -DGLFW_INCLUDE_NONE -DGLM_FORCE_INLINE
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -ffast-math -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -ffast-math -O2 -std=c++17
LIBS += ../bin/Beta-windows/GLFW/GLFW.lib ../bin/Beta-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Beta-windows/GLFW/GLFW.lib ../bin/Beta-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s

else ifeq ($(config),release)
TARGETDIR = ../bin/Release-windows-Jukcraft
TARGET = $(TARGETDIR)/Jukcraft.exe
OBJDIR = ../bin-int/Release-windows-Jukcraft
DEFINES += -DGLFW_INCLUDE_NONE -DGLM_FORCE_INLINE -DSPDLOG_NO_EXCEPTIONS
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -flto -ffast-math -fomit-frame-pointer -O3
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -flto -ffast-math -fomit-frame-pointer -O3 -std=c++17 -fno-exceptions -fno-rtti
LIBS += ../bin/Release-windows/GLFW/GLFW.lib ../bin/Release-windows/Glad/Glad.lib -lopengl32 -lgdi32
LDDEPS += ../bin/Release-windows/GLFW/GLFW.lib ../bin/Release-windows/Glad/Glad.lib
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -flto -s

endif

OBJECTS := \
$(OBJDIR)/App.o \
$(OBJDIR)/Camera.o \
$(OBJDIR)/Game.o \
$(OBJDIR)/Log.o \
$(OBJDIR)/Window.o \
$(OBJDIR)/BipedEntity.o \
$(OBJDIR)/HitRay.o \
$(OBJDIR)/LivingEntity.o \
$(OBJDIR)/Player.o \
$(OBJDIR)/main.o \
$(OBJDIR)/pch.o \
$(OBJDIR)/DynamicBuffer.o \
$(OBJDIR)/stb_build.o \
$(OBJDIR)/LightEngine.o \
$(OBJDIR)/World.o \
$(OBJDIR)/Chunk.o \
$(OBJDIR)/ChunkManager.o \

RESOURCES := \

CUSTOMFILES := \

SHELLTYPE := posix
ifeq (.exe,$(findstring .exe,$(ComSpec)))
SHELLTYPE := msdos
endif
# Per File Configurations
# #############################################


# File sets
# #############################################

GENERATED :=
OBJECTS :=

GENERATED += $(OBJDIR)/App.o
GENERATED += $(OBJDIR)/BipedEntity.o
GENERATED += $(OBJDIR)/Camera.o
GENERATED += $(OBJDIR)/Chunk.o
GENERATED += $(OBJDIR)/ChunkManager.o
GENERATED += $(OBJDIR)/DynamicBuffer.o
GENERATED += $(OBJDIR)/Game.o
GENERATED += $(OBJDIR)/HitRay.o
GENERATED += $(OBJDIR)/LightEngine.o
GENERATED += $(OBJDIR)/LivingEntity.o
GENERATED += $(OBJDIR)/Log.o
GENERATED += $(OBJDIR)/Mesh.o
GENERATED += $(OBJDIR)/Player.o
GENERATED += $(OBJDIR)/Window.o
GENERATED += $(OBJDIR)/World.o
GENERATED += $(OBJDIR)/main.o
GENERATED += $(OBJDIR)/pch.o
GENERATED += $(OBJDIR)/stb_build.o
OBJECTS += $(OBJDIR)/App.o
OBJECTS += $(OBJDIR)/BipedEntity.o
OBJECTS += $(OBJDIR)/Camera.o
OBJECTS += $(OBJDIR)/Chunk.o
OBJECTS += $(OBJDIR)/ChunkManager.o
OBJECTS += $(OBJDIR)/DynamicBuffer.o
OBJECTS += $(OBJDIR)/Game.o
OBJECTS += $(OBJDIR)/HitRay.o
OBJECTS += $(OBJDIR)/LightEngine.o
OBJECTS += $(OBJDIR)/LivingEntity.o
OBJECTS += $(OBJDIR)/Log.o
OBJECTS += $(OBJDIR)/Mesh.o
OBJECTS += $(OBJDIR)/Player.o
OBJECTS += $(OBJDIR)/Window.o
OBJECTS += $(OBJDIR)/World.o
OBJECTS += $(OBJDIR)/main.o
OBJECTS += $(OBJDIR)/pch.o
OBJECTS += $(OBJDIR)/stb_build.o

# Rules
# #############################################

all: $(TARGET)
@:

$(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR)
$(TARGET): $(GENERATED) $(OBJECTS) $(LDDEPS) | $(TARGETDIR)
$(PRELINKCMDS)
@echo Linking Jukcraft
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)

$(CUSTOMFILES): | $(OBJDIR)

$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
Expand All @@ -152,80 +148,92 @@ clean:
@echo Cleaning Jukcraft
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(GENERATED)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(GENERATED)) rmdir /s /q $(subst /,\\,$(GENERATED))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif

prebuild:
prebuild: | $(OBJDIR)
$(PREBUILDCMDS)

prelink:
$(PRELINKCMDS)

ifneq (,$(PCH))
$(OBJECTS): $(GCH) $(PCH) | $(OBJDIR)
$(GCH): $(PCH) | $(OBJDIR)
$(OBJECTS): $(GCH) | $(PCH_PLACEHOLDER)
$(GCH): $(PCH) | prebuild
@echo $(notdir $<)
$(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) touch "$@"
else
$(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | $(OBJDIR)
$(OBJECTS): | prebuild
endif


# File Rules
# #############################################

$(OBJDIR)/App.o: src/core/App.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Camera.o: src/core/Camera.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Game.o: src/core/Game.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Log.o: src/core/Log.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Window.o: src/core/Window.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/BipedEntity.o: src/entity/BipedEntity.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/HitRay.o: src/entity/HitRay.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/LivingEntity.o: src/entity/LivingEntity.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Player.o: src/entity/player/Player.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/main.o: src/main.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/pch.o: src/pch.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Mesh.o: src/renderer/chunk/Mesh.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/DynamicBuffer.o: src/renderer/gfx/buffers/DynamicBuffer.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/stb_build.o: src/vendor/stb/stb_build.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/LightEngine.o: src/world/LightEngine.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/World.o: src/world/World.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/Chunk.o: src/world/chunk/Chunk.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/ChunkManager.o: src/world/chunk/ChunkManager.cpp
@echo $(notdir $<)
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(SILENT) $(CXX) -include $(PCH_PLACEHOLDER) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"

-include $(OBJECTS:%.o=%.d)
ifneq (,$(PCH))
-include $(OBJDIR)/$(notdir $(PCH)).d
-include $(PCH_PLACEHOLDER).d
endif
Loading

0 comments on commit ad45d9e

Please sign in to comment.