Some cleanup to the Makefile.

- Rename REFGL to REFGL1 for consistency with REFGL3.
- Fix some comments.
- There's no need to link flash.c and rand.c into both renderer libs.
This commit is contained in:
Yamagi Burmeister 2017-04-10 08:53:32 +02:00 committed by Daniel Gibson
parent 5d3f024f82
commit 4bd263c4d4
3 changed files with 17 additions and 27 deletions

View File

@ -136,7 +136,7 @@ list(APPEND yquake2LinkerFlags ${CMAKE_DL_LIBS})
# With all of those libraries and user defined paths # With all of those libraries and user defined paths
# added, lets give them to the compiler and linker. # added, lets give them to the compiler and linker.
include_directories(${yquake2IncludeDirectories}) include_directories(${yquake2IncludeDirectories} ${CMAKE_SOURCE_DIR}/src/client/refresh/gl3/glad/include)
link_directories(${yquake2LinkerDirectories}) link_directories(${yquake2LinkerDirectories})
set(Backends-Generic-Source set(Backends-Generic-Source

View File

@ -136,7 +136,6 @@ CDA_DISABLED:=yes
endif endif
endif endif
# ---------- # ----------
# Base CFLAGS. # Base CFLAGS.
@ -317,6 +316,8 @@ endif
# Builds everything # Builds everything
all: config client server game ref_gl1 ref_gl3 all: config client server game ref_gl1 ref_gl3
# ----------
# Print config values # Print config values
config: config:
@echo "Build configuration" @echo "Build configuration"
@ -591,7 +592,6 @@ ifeq ($(WITH_SDL2),yes)
release/ref_gl3.dll : CFLAGS += -DSDL2 release/ref_gl3.dll : CFLAGS += -DSDL2
endif endif
# FIXME: -lopengl32 ?? shouldn't be needed, SDL should load it dynamically..
release/ref_gl3.dll : LDFLAGS += -shared release/ref_gl3.dll : LDFLAGS += -shared
else ifeq ($(YQ2_OSTYPE), Darwin) else ifeq ($(YQ2_OSTYPE), Darwin)
@ -623,9 +623,6 @@ endif
endif # OS specific ref_gl3 shit endif # OS specific ref_gl3 shit
# TODO: glad_dbg support
GLAD_INCLUDE = -Isrc/client/refresh/gl3/glad/include
build/ref_gl3/%.o: %.c build/ref_gl3/%.o: %.c
@echo "===> CC $<" @echo "===> CC $<"
${Q}mkdir -p $(@D) ${Q}mkdir -p $(@D)
@ -809,7 +806,7 @@ endif
# ---------- # ----------
REFGL_OBJS_ := \ REFGL1_OBJS_ := \
src/client/refresh/gl/qgl.o \ src/client/refresh/gl/qgl.o \
src/client/refresh/gl/r_draw.o \ src/client/refresh/gl/r_draw.o \
src/client/refresh/gl/r_image.o \ src/client/refresh/gl/r_image.o \
@ -828,15 +825,13 @@ REFGL_OBJS_ := \
src/client/refresh/files/pcx.o \ src/client/refresh/files/pcx.o \
src/client/refresh/files/stb.o \ src/client/refresh/files/stb.o \
src/client/refresh/files/wal.o \ src/client/refresh/files/wal.o \
src/common/shared/flash.o \
src/common/shared/rand.o \
src/common/shared/shared.o src/common/shared/shared.o
ifeq ($(YQ2_OSTYPE), Windows) ifeq ($(YQ2_OSTYPE), Windows)
REFGL_OBJS_ += \ REFGL1_OBJS_ += \
src/backends/windows/shared/mem.o src/backends/windows/shared/mem.o
else # not Windows else # not Windows
REFGL_OBJS_ += \ REFGL1_OBJS_ += \
src/backends/unix/shared/hunk.o src/backends/unix/shared/hunk.o
endif endif
@ -857,17 +852,12 @@ REFGL3_OBJS_ := \
src/client/refresh/gl3/gl3_shaders.o \ src/client/refresh/gl3/gl3_shaders.o \
src/client/refresh/gl3/gl3_md2.o \ src/client/refresh/gl3/gl3_md2.o \
src/client/refresh/gl3/gl3_sp2.o \ src/client/refresh/gl3/gl3_sp2.o \
src/client/refresh/gl3/glad/src/glad.o \
src/client/refresh/files/pcx.o \ src/client/refresh/files/pcx.o \
src/client/refresh/files/stb.o \ src/client/refresh/files/stb.o \
src/client/refresh/files/wal.o \ src/client/refresh/files/wal.o \
src/common/shared/flash.o \
src/common/shared/rand.o \
src/common/shared/shared.o src/common/shared/shared.o
# TODO: glad_dbg support
REFGL3_OBJS_ += \
src/client/refresh/gl3/glad/src/glad.o
ifeq ($(YQ2_OSTYPE), Windows) ifeq ($(YQ2_OSTYPE), Windows)
REFGL3_OBJS_ += \ REFGL3_OBJS_ += \
src/backends/windows/shared/mem.o src/backends/windows/shared/mem.o
@ -929,7 +919,7 @@ endif
# Rewrite pathes to our object directory # Rewrite pathes to our object directory
CLIENT_OBJS = $(patsubst %,build/client/%,$(CLIENT_OBJS_)) CLIENT_OBJS = $(patsubst %,build/client/%,$(CLIENT_OBJS_))
REFGL_OBJS = $(patsubst %,build/ref_gl1/%,$(REFGL_OBJS_)) REFGL1_OBJS = $(patsubst %,build/ref_gl1/%,$(REFGL1_OBJS_))
REFGL3_OBJS = $(patsubst %,build/ref_gl3/%,$(REFGL3_OBJS_)) REFGL3_OBJS = $(patsubst %,build/ref_gl3/%,$(REFGL3_OBJS_))
SERVER_OBJS = $(patsubst %,build/server/%,$(SERVER_OBJS_)) SERVER_OBJS = $(patsubst %,build/server/%,$(SERVER_OBJS_))
GAME_OBJS = $(patsubst %,build/baseq2/%,$(GAME_OBJS_)) GAME_OBJS = $(patsubst %,build/baseq2/%,$(GAME_OBJS_))
@ -938,7 +928,7 @@ GAME_OBJS = $(patsubst %,build/baseq2/%,$(GAME_OBJS_))
# Generate header dependencies # Generate header dependencies
CLIENT_DEPS= $(CLIENT_OBJS:.o=.d) CLIENT_DEPS= $(CLIENT_OBJS:.o=.d)
REFGL_DEPS= $(REFGL_OBJS:.o=.d) REFGL1_DEPS= $(REFGL1_OBJS:.o=.d)
REFGL3_DEPS= $(REFGL3_OBJS:.o=.d) REFGL3_DEPS= $(REFGL3_OBJS:.o=.d)
SERVER_DEPS= $(SERVER_OBJS:.o=.d) SERVER_DEPS= $(SERVER_OBJS:.o=.d)
GAME_DEPS= $(GAME_OBJS:.o=.d) GAME_DEPS= $(GAME_OBJS:.o=.d)
@ -947,7 +937,7 @@ GAME_DEPS= $(GAME_OBJS:.o=.d)
# Suck header dependencies in # Suck header dependencies in
-include $(CLIENT_DEPS) -include $(CLIENT_DEPS)
-include $(REFGL_DEPS) -include $(REFGL1_DEPS)
-include $(REFGL3_DEPS) -include $(REFGL3_DEPS)
-include $(SERVER_DEPS) -include $(SERVER_DEPS)
-include $(GAME_DEPS) -include $(GAME_DEPS)
@ -980,18 +970,18 @@ endif
# release/ref_gl1.so # release/ref_gl1.so
ifeq ($(YQ2_OSTYPE), Windows) ifeq ($(YQ2_OSTYPE), Windows)
release/ref_gl1.dll : $(REFGL_OBJS) release/ref_gl1.dll : $(REFGL1_OBJS)
@echo "===> LD $@" @echo "===> LD $@"
${Q}$(CC) $(REFGL_OBJS) $(LDFLAGS) $(DLL_SDLLDFLAGS) -o $@ ${Q}$(CC) $(REFGL1_OBJS) $(LDFLAGS) $(DLL_SDLLDFLAGS) -o $@
$(Q)strip $@ $(Q)strip $@
else ifeq ($(YQ2_OSTYPE), Darwin) else ifeq ($(YQ2_OSTYPE), Darwin)
release/ref_gl1.dylib : $(REFGL_OBJS) release/ref_gl1.dylib : $(REFGL1_OBJS)
@echo "===> LD $@" @echo "===> LD $@"
${Q}$(CC) $(REFGL_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@ ${Q}$(CC) $(REFGL1_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@
else else
release/ref_gl1.so : $(REFGL_OBJS) release/ref_gl1.so : $(REFGL1_OBJS)
@echo "===> LD $@" @echo "===> LD $@"
${Q}$(CC) $(REFGL_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@ ${Q}$(CC) $(REFGL1_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@
endif endif
# release/ref_gl3.so # release/ref_gl3.so

View File

@ -38,7 +38,7 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glext.h> #include <GL/glext.h>
#else #else
#include <glad/glad.h> #include "../glad/include/glad/glad.h"
#endif #endif
#include "../../ref_shared.h" #include "../../ref_shared.h"