mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-26 05:40:49 +00:00
Server makefile is done too, just cosmetics and a better clean target
This commit is contained in:
parent
4ebf133971
commit
be84abf0b1
1 changed files with 25 additions and 46 deletions
|
@ -28,41 +28,23 @@ ifneq ($(SRC_DIR),.)
|
||||||
SRC_DIR_INC = -I$(SRC_DIR)
|
SRC_DIR_INC = -I$(SRC_DIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MAKE_SURE_DIR = if test -d "$(BUILD_DIR)/$$DIR"; \
|
|
||||||
then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
echo "Creating directory $(BUILD_DIR)/$$DIR"; \
|
|
||||||
mkdir -p $(BUILD_DIR)/$$DIR; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# Source files
|
# Source files
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
|
||||||
# System specific source files
|
|
||||||
#
|
|
||||||
|
|
||||||
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
|
QW_SRV_SYS_SRC = @QW_SRV_SYS_SRC@
|
||||||
|
|
||||||
#
|
|
||||||
# Networking source files
|
# Networking source files
|
||||||
#
|
# FIXME: Should not assume UNIX
|
||||||
# XXX - Should not assume UNIX
|
|
||||||
QW_NET_SRC = net_udp.c net_com.c mdfour.c
|
QW_NET_SRC = net_udp.c net_com.c mdfour.c
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Server source files
|
# Server source files
|
||||||
#
|
|
||||||
# Server-related source used by all
|
|
||||||
SRV_SRC = sv_main.c sv_user.c sv_move.c sv_phys.c
|
SRV_SRC = sv_main.c sv_user.c sv_move.c sv_phys.c
|
||||||
# Server-related source used just by QW server
|
|
||||||
QW_SRV_SRC = sv_ccmds.c sv_ents.c sv_init.c sv_send.c sv_nchan.c world.c
|
QW_SRV_SRC = sv_ccmds.c sv_ents.c sv_init.c sv_send.c sv_nchan.c world.c
|
||||||
# Server-related source used just by UQ
|
|
||||||
SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
|
SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,62 +68,59 @@ GENERAL_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c \
|
||||||
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC) \
|
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC) \
|
||||||
register_check.c
|
register_check.c
|
||||||
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
||||||
# XXX - add dos/win specifc source
|
# FIXME: add dos/win specifc source
|
||||||
|
|
||||||
|
|
||||||
all: $(targets)
|
all: $(targets)
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# qw-server
|
# QuakeWorld server target
|
||||||
#
|
#
|
||||||
OBJSqw-server = $(patsubst %,$(BUILD_DIR)/srv/%, \
|
|
||||||
$(addsuffix .@OBJEXT@, $(basename $(ALL_QW_SRV_SRC) .c .s)))
|
ALL_SRV_OBJS = $(patsubst %,$(BUILD_DIR)/%, $(addsuffix .@OBJEXT@,\
|
||||||
|
$(basename $(ALL_QW_SRV_SRC) .c .s)))
|
||||||
|
|
||||||
SRV_CFLAGS = -DSRV $(X_CFLAGS)
|
SRV_CFLAGS = -DSRV $(X_CFLAGS)
|
||||||
# XXX - Don't use X_EXTRA_LIBS below
|
# FIXME: Don't use X_EXTRA_LIBS below
|
||||||
SRV_LDFLAGS = @X_EXTRA_LIBS@
|
SRV_LDFLAGS = @X_EXTRA_LIBS@
|
||||||
|
|
||||||
srv_DIR:
|
srv_DIR:
|
||||||
@DIR=srv; $(MAKE_SURE_DIR)
|
mkdir -p $(BUILD_DIR)
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
|
||||||
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.c
|
|
||||||
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(BUILD_DIR)/srv/%.o: $(SRC_DIR)/%.s
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.s
|
||||||
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
||||||
|
|
||||||
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.c
|
$(BUILD_DIR)/%.o: $(COMMON_DIR)/%.c
|
||||||
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(BUILD_DIR)/srv/%.o: $(QW_COMMON_DIR)/%.c
|
$(BUILD_DIR)/%.o: $(QW_COMMON_DIR)/%.c
|
||||||
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) $(SRV_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(BUILD_DIR)/srv/%.o: $(COMMON_DIR)/%.s
|
$(BUILD_DIR)/%.o: $(COMMON_DIR)/%.s
|
||||||
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
||||||
|
|
||||||
$(SRVQUAKE): srv_DIR $(BUILD_DIR)/../$(SRVQUAKE)
|
$(SRVQUAKE): srv_DIR $(BUILD_DIR)/../$(SRVQUAKE)
|
||||||
|
|
||||||
$(BUILD_DIR)/../$(SRVQUAKE): $(OBJSqw-server)
|
$(BUILD_DIR)/../$(SRVQUAKE): $(ALL_SRV_OBJS)
|
||||||
$(CC) $(CFLAGS) $(OBJSqw-server) $(SRV_LDFLAGS) $(LDFLAGS) -o $(BUILD_DIR)/../$(SRVQUAKE)
|
$(CC) $(CFLAGS) $(ALL_SRV_OBJS) $(SRV_LDFLAGS) $(LDFLAGS) \
|
||||||
# XXX - Can this be automated?
|
-o $(BUILD_DIR)/../$(SRVQUAKE)
|
||||||
clean-$(SRVQUAKE):
|
|
||||||
rm -rf $(BUILD_DIR)/srv
|
|
||||||
|
|
||||||
clean: clean-$(SRVQUAKE)
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# cleaning (clean, distclean)
|
# Misc Targets
|
||||||
#
|
#
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f config.cache config.log config.status Makefile
|
rm -f config.cache config.log config.status Makefile
|
||||||
|
|
||||||
clean: $(CLEAN_TARGETS)
|
clean: clean-soft clean-gl $(CLEAN_TARGETS)
|
||||||
for i in $(targets); do \
|
rm -r $(BUILD_DIR)
|
||||||
rm -f $(BUILD_DIR)/../$$i; \
|
|
||||||
done
|
|
||||||
|
|
||||||
install: $(targets)
|
install: $(targets)
|
||||||
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)$(prefix)$(bindir)
|
$(PROJECT_DIR)/mkinstalldirs $(DESTDIR)$(prefix)$(bindir)
|
||||||
|
@ -149,7 +128,7 @@ install: $(targets)
|
||||||
$(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
|
$(PROJECT_DIR)/install-sh -m 755 $(BUILD_DIR)/../$$i \
|
||||||
$(DESTDIR)$(prefix)$(bindir)/$$i; \
|
$(DESTDIR)$(prefix)$(bindir)/$$i; \
|
||||||
done
|
done
|
||||||
-rmdir $(BUILD_DIR)
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
@echo check not implemented
|
@echo check not implemented
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue