Updated makefiles for Linux build

This commit is contained in:
MihailRis 2022-02-28 16:22:31 +03:00 committed by GitHub
parent 4c2fd0fce2
commit 2a158bfb46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 40 additions and 20 deletions

View File

@ -42,16 +42,30 @@ endif
-include ../makefile.defs
OPTIONAL_TOOL_DEPS := \
$(wildcard ../makefile.defs) \
$(wildcard ../makefile.init) \
$(wildcard ../makefile.targets) \
BUILD_ARTIFACT_NAME := voxel_engine
BUILD_ARTIFACT_EXTENSION :=
BUILD_ARTIFACT_PREFIX :=
BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: voxel_engine
all: main-build
# Main-build Target
main-build: voxel_engine
# Tool invocations
voxel_engine: $(OBJS) $(USER_OBJS)
voxel_engine: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS)
@echo 'Building target: $@'
@echo 'Invoking: Cross G++ Linker'
g++ -o "voxel_engine" $(OBJS) $(USER_OBJS) $(LIBS)
g++ -pthread -o "voxel_engine" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
@ -60,6 +74,6 @@ clean:
-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(OBJS)$(C_UPPER_DEPS)$(CXX_DEPS)$(C_DEPS)$(CPP_DEPS) voxel_engine
-@echo ' '
.PHONY: all clean dependents
.PHONY: all clean dependents main-build
-include ../makefile.targets

View File

@ -17,10 +17,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/files/%.o: ../src/files/%.cpp
src/files/%.o: ../src/files/%.cpp src/files/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -26,10 +26,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/graphics/%.o: ../src/graphics/%.cpp
src/graphics/%.o: ../src/graphics/%.cpp src/graphics/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -20,10 +20,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/lighting/%.o: ../src/lighting/%.cpp
src/lighting/%.o: ../src/lighting/%.cpp src/lighting/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -14,10 +14,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/loaders/%.o: ../src/loaders/%.cpp
src/loaders/%.o: ../src/loaders/%.cpp src/loaders/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -17,10 +17,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/physics/%.o: ../src/physics/%.cpp
src/physics/%.o: ../src/physics/%.cpp src/physics/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -14,10 +14,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/%.o: ../src/%.cpp
src/%.o: ../src/%.cpp src/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -7,6 +7,8 @@ CPP_SRCS += \
../src/voxels/Block.cpp \
../src/voxels/Chunk.cpp \
../src/voxels/Chunks.cpp \
../src/voxels/ChunksController.cpp \
../src/voxels/ChunksLoader.cpp \
../src/voxels/WorldGenerator.cpp \
../src/voxels/voxel.cpp
@ -14,6 +16,8 @@ OBJS += \
./src/voxels/Block.o \
./src/voxels/Chunk.o \
./src/voxels/Chunks.o \
./src/voxels/ChunksController.o \
./src/voxels/ChunksLoader.o \
./src/voxels/WorldGenerator.o \
./src/voxels/voxel.o
@ -21,15 +25,17 @@ CPP_DEPS += \
./src/voxels/Block.d \
./src/voxels/Chunk.d \
./src/voxels/Chunks.d \
./src/voxels/ChunksController.d \
./src/voxels/ChunksLoader.d \
./src/voxels/WorldGenerator.d \
./src/voxels/voxel.d
# Each subdirectory must supply rules for building sources it contributes
src/voxels/%.o: ../src/voxels/%.cpp
src/voxels/%.o: ../src/voxels/%.cpp src/voxels/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View File

@ -20,10 +20,10 @@ CPP_DEPS += \
# Each subdirectory must supply rules for building sources it contributes
src/window/%.o: ../src/window/%.cpp
src/window/%.o: ../src/window/%.cpp src/window/subdir.mk
@echo 'Building file: $<'
@echo 'Invoking: Cross G++ Compiler'
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '