make V=1 shows gcc command line

This commit is contained in:
Ludwig Nussel 2007-08-27 07:02:54 +00:00
parent 034e6e8f20
commit a2d413428a
2 changed files with 68 additions and 56 deletions

123
Makefile
View file

@ -32,6 +32,14 @@ BUILD_SERVER =
BUILD_GAME_SO = BUILD_GAME_SO =
BUILD_GAME_QVM = BUILD_GAME_QVM =
ifeq ($(V),1)
echo_cmd=@:
Q=
else
echo_cmd=@echo
Q=@
endif
############################################################################# #############################################################################
# #
# If you require a different configuration from the defaults below, create a # If you require a different configuration from the defaults below, create a
@ -756,18 +764,18 @@ ifeq ($(USE_SVN),1)
endif endif
define DO_CC define DO_CC
@echo "CC $<" $(echo_cmd) "CC $<"
@$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
endef endef
define DO_SMP_CC define DO_SMP_CC
@echo "SMP_CC $<" $(echo_cmd) "SMP_CC $<"
@$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $<
endef endef
define DO_BOT_CC define DO_BOT_CC
@echo "BOT_CC $<" $(echo_cmd) "BOT_CC $<"
@$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $<
endef endef
ifeq ($(GENERATE_DEPENDENCIES),1) ifeq ($(GENERATE_DEPENDENCIES),1)
@ -775,30 +783,30 @@ ifeq ($(GENERATE_DEPENDENCIES),1)
endif endif
define DO_SHLIB_CC define DO_SHLIB_CC
@echo "SHLIB_CC $<" $(echo_cmd) "SHLIB_CC $<"
@$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
@$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_SHLIB_CC_MISSIONPACK define DO_SHLIB_CC_MISSIONPACK
@echo "SHLIB_CC_MISSIONPACK $<" $(echo_cmd) "SHLIB_CC_MISSIONPACK $<"
@$(CC) -DMISSIONPACK $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(Q)$(CC) -DMISSIONPACK $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
@$(DO_QVM_DEP) $(Q)$(DO_QVM_DEP)
endef endef
define DO_AS define DO_AS
@echo "AS $<" $(echo_cmd) "AS $<"
@$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< $(Q)$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
endef endef
define DO_DED_CC define DO_DED_CC
@echo "DED_CC $<" $(echo_cmd) "DED_CC $<"
@$(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(CFLAGS) -o $@ -c $< $(Q)$(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(CFLAGS) -o $@ -c $<
endef endef
define DO_WINDRES define DO_WINDRES
@echo "WINDRES $<" $(echo_cmd) "WINDRES $<"
@$(WINDRES) -i $< -o $@ $(Q)$(WINDRES) -i $< -o $@
endef endef
@ -810,16 +818,19 @@ default: release
all: debug release all: debug release
debug: debug:
@$(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS)" @$(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS)" V=$(V)
release: release:
@$(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS)" @$(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS)" V=$(V)
# Create the build directories and tools, print out # Create the build directories and tools, print out
# an informational message, then start building # an informational message, then start building
targets: makedirs tools targets: makedirs tools
@echo "" @echo ""
@echo "Building ioquake3 in $(B):" @echo "Building ioquake3 in $(B):"
@echo " ARCH: $(ARCH)"
@echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)"
@echo " COMPILE_ARCH: $(COMPILE_ARCH)"
@echo " CC: $(CC)" @echo " CC: $(CC)"
@echo "" @echo ""
@echo " CFLAGS:" @echo " CFLAGS:"
@ -834,7 +845,7 @@ targets: makedirs tools
echo " $$i"; \ echo " $$i"; \
done done
@echo "" @echo ""
@$(MAKE) $(TARGETS) @$(MAKE) $(TARGETS) V=$(V)
makedirs: makedirs:
@if [ ! -d $(BUILD_DIR) ];then $(MKDIR) $(BUILD_DIR);fi @if [ ! -d $(BUILD_DIR) ];then $(MKDIR) $(BUILD_DIR);fi
@ -872,13 +883,13 @@ tools:
endif endif
define DO_Q3LCC define DO_Q3LCC
@echo "Q3LCC $<" $(echo_cmd) "Q3LCC $<"
@$(Q3LCC) -o $@ $< $(Q)$(Q3LCC) -o $@ $<
endef endef
define DO_Q3LCC_MISSIONPACK define DO_Q3LCC_MISSIONPACK
@echo "Q3LCC_MISSIONPACK $<" $(echo_cmd) "Q3LCC_MISSIONPACK $<"
@$(Q3LCC) -DMISSIONPACK -o $@ $< $(Q)$(Q3LCC) -DMISSIONPACK -o $@ $<
endef endef
@ -1110,13 +1121,13 @@ else
endif endif
$(B)/ioquake3.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN) $(B)/ioquake3.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \ $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \
$(LDFLAGS) $(LIBSDLMAIN) $(LDFLAGS) $(LIBSDLMAIN)
$(B)/ioquake3-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN) $(B)/ioquake3-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \ $(Q)$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
$(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN) $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
ifneq ($(strip $(LIBSDLMAIN)),) ifneq ($(strip $(LIBSDLMAIN)),)
@ -1232,8 +1243,8 @@ ifeq ($(HAVE_VM_COMPILED),true)
endif endif
$(B)/ioq3ded.$(ARCH)$(BINEXT): $(Q3DOBJ) $(B)/ioq3ded.$(ARCH)$(BINEXT): $(Q3DOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) $(Q)$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
@ -1271,12 +1282,12 @@ Q3CGOBJ = $(Q3CGOBJ_) $(B)/baseq3/cgame/cg_syscalls.o
Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ) $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
$(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q)$(Q3ASM) -o $@ $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
############################################################################# #############################################################################
## MISSIONPACK CGAME ## MISSIONPACK CGAME
@ -1314,12 +1325,12 @@ MPCGOBJ = $(MPCGOBJ_) $(B)/missionpack/cgame/cg_syscalls.o
MPCGVMOBJ = $(MPCGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm MPCGVMOBJ = $(MPCGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
$(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ) $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ) $(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ)
$(B)/missionpack/vm/cgame.qvm: $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm $(B)/missionpack/vm/cgame.qvm: $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm $(Q)$(Q3ASM) -o $@ $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm
@ -1366,12 +1377,12 @@ Q3GOBJ = $(Q3GOBJ_) $(B)/baseq3/game/g_syscalls.o
Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ) $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
$(B)/baseq3/vm/qagame.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(B)/baseq3/vm/qagame.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm $(Q)$(Q3ASM) -o $@ $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
############################################################################# #############################################################################
## MISSIONPACK GAME ## MISSIONPACK GAME
@ -1416,12 +1427,12 @@ MPGOBJ = $(MPGOBJ_) $(B)/missionpack/game/g_syscalls.o
MPGVMOBJ = $(MPGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm MPGVMOBJ = $(MPGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
$(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ) $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ) $(Q)$(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ)
$(B)/missionpack/vm/qagame.qvm: $(MPGVMOBJ) $(GDIR)/g_syscalls.asm $(B)/missionpack/vm/qagame.qvm: $(MPGVMOBJ) $(GDIR)/g_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(MPGVMOBJ) $(GDIR)/g_syscalls.asm $(Q)$(Q3ASM) -o $@ $(MPGVMOBJ) $(GDIR)/g_syscalls.asm
@ -1478,12 +1489,12 @@ Q3UIOBJ = $(Q3UIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ) $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
$(B)/baseq3/vm/ui.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(B)/baseq3/vm/ui.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q)$(Q3ASM) -o $@ $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm
############################################################################# #############################################################################
## MISSIONPACK UI ## MISSIONPACK UI
@ -1505,12 +1516,12 @@ MPUIOBJ = $(MPUIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
MPUIVMOBJ = $(MPUIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm MPUIVMOBJ = $(MPUIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
$(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ) $(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ)
@echo "LD $@" $(echo_cmd) "LD $@"
@$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ) $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ)
$(B)/missionpack/vm/ui.qvm: $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm $(B)/missionpack/vm/ui.qvm: $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm
@echo "Q3ASM $@" $(echo_cmd) "Q3ASM $@"
@$(Q3ASM) -o $@ $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm $(Q)$(Q3ASM) -o $@ $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm
@ -1699,7 +1710,7 @@ distclean: clean toolsclean
@rm -rf $(BUILD_DIR) @rm -rf $(BUILD_DIR)
installer: release installer: release
@$(MAKE) VERSION=$(VERSION) -C $(LOKISETUPDIR) @$(MAKE) VERSION=$(VERSION) -C $(LOKISETUPDIR) V=$(V)
dist: dist:
rm -rf ioquake3-$(SVN_VERSION) rm -rf ioquake3-$(SVN_VERSION)

1
README
View file

@ -88,6 +88,7 @@ following variables may be set, either on the command line or in
Makefile.local: Makefile.local:
OPTIMIZE - use this for custom CFLAGS OPTIMIZE - use this for custom CFLAGS
V - set to show cc command line when building
DEFAULT_BASEDIR - extra path to search for baseq3 and such DEFAULT_BASEDIR - extra path to search for baseq3 and such
BUILD_SERVER - build the 'ioq3ded' server binary BUILD_SERVER - build the 'ioq3ded' server binary
BUILD_CLIENT - build the 'ioquake3' client binary BUILD_CLIENT - build the 'ioquake3' client binary