Makefile support for the refresher under Windows

This commit is contained in:
Yamagi Burmeister 2012-06-04 11:49:11 +02:00
parent 51ca0ca673
commit e652f32a64

View file

@ -319,13 +319,35 @@ endif
# ---------- # ----------
# The refresher # The refresher
ifeq ($(OSTYPE), Windows)
refresher: refresher:
@echo '===> Building ref_gl.so' @echo "===> Building ref_gl.dll"
${Q}mkdir.exe -p release
$(MAKE) release/ref_gl.dll
build/refresher/%.o: %.c
@echo "===> CC $<"
${Q}mkdir.exe -p $(@D)
${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $<
release/ref_gl.so : LDFLAGS += -shared
ifeq ($(WITH_X11GAMMA),yes)
release/ref_gl.so : CFLAGS += -DX11GAMMA
endif
ifeq ($(WITH_RETEXTURING),yes)
release/ref_gl.so : CFLAGS += -DRETEXTURE
release/ref_gl.so : LDFLAGS += -ljpeg
endif
else
refresher:
@echo "===> Building ref_gl.so"
${Q}mkdir -p release ${Q}mkdir -p release
$(MAKE) release/ref_gl.so $(MAKE) release/ref_gl.so
build/refresher/%.o: %.c build/refresher/%.o: %.c
@echo '===> CC $<' @echo "===> CC $<"
${Q}mkdir -p $(@D) ${Q}mkdir -p $(@D)
${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $< ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $<
@ -340,6 +362,7 @@ ifeq ($(WITH_RETEXTURING),yes)
release/ref_gl.so : CFLAGS += -DRETEXTURE release/ref_gl.so : CFLAGS += -DRETEXTURE
release/ref_gl.so : LDFLAGS += -ljpeg release/ref_gl.so : LDFLAGS += -ljpeg
endif endif
endif
# ---------- # ----------
@ -592,9 +615,16 @@ OPENGL_OBJS_ = \
src/sdl/input.o \ src/sdl/input.o \
src/sdl/refresh.o \ src/sdl/refresh.o \
src/common/glob.o \ src/common/glob.o \
src/common/shared/shared.o \ src/common/shared/shared.o
ifeq ($(OSTYPE), Windows)
OPENGL_OBJS_ += \
src/windows/mem.o
else
OPENGL_OBJS_ += \
src/unix/hunk.o \ src/unix/hunk.o \
src/unix/qgl.o src/unix/qgl.o
endif
# ---------- # ----------
@ -640,14 +670,20 @@ release/q2ded.exe : $(SERVER_OBJS)
${Q}$(CC) $(SERVER_OBJS) $(LDFLAGS) -o $@ ${Q}$(CC) $(SERVER_OBJS) $(LDFLAGS) -o $@
else else
release/q2ded : $(SERVER_OBJS) release/q2ded : $(SERVER_OBJS)
@echo '===> LD $@' @echo "===> LD $@"
${Q}$(CC) $(SERVER_OBJS) $(LDFLAGS) -o $@ ${Q}$(CC) $(SERVER_OBJS) $(LDFLAGS) -o $@
endif endif
# release/ref_gl.so # release/ref_gl.so
release/ref_gl.so : $(OPENGL_OBJS) ifeq ($(OSTYPE), Windows)
@echo '===> LD $@' release/ref_gl.dll : $(OPENGL_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(OPENGL_OBJS) $(LDFLAGS) $(X11LDFLAGS) -o $@ ${Q}$(CC) $(OPENGL_OBJS) $(LDFLAGS) $(X11LDFLAGS) -o $@
else
release/ref_gl.so : $(OPENGL_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(OPENGL_OBJS) $(LDFLAGS) $(X11LDFLAGS) -o $@
endif
# release/baseq2/game.so # release/baseq2/game.so
ifeq ($(OSTYPE), Windows) ifeq ($(OSTYPE), Windows)