#
# Empire - A multi-player, client/server Internet based war game.
-# Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+# Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure
#
# This program is free software; you can redistribute it and/or modify
#
# ---
#
-# Make.mk:
+# Make.mk: The real Makefile, included by GNUmakefile
#
# Known contributors to this file:
# Markus Armbruster, 2005-2007
.DELETE_ON_ERROR:
# Source files
--include sources.mk
+ifeq ($(revctrl),git)
+src := $(shell cd $(srcdir) && git-ls-files)
+else
+include $(srcdir)/sources.mk
+endif
dirs := $(sort $(dir $(src)))
csrc := $(filter %.c, $(src))
tsrc := $(filter %.t, $(src))
man6 := $(filter man/%.6, $(src))
builtins := $(filter src/lib/global/%.config, $(src))
-# Info topics and subjects
+# Info subjects (automatically generated)
-include subjects.mk
# Abbreviations
$(server): $(filter src/server/% src/lib/as/% src/lib/commands/% src/lib/player/% src/lib/subs/% src/lib/update/%, $(obj)) $(empth_obj) $(libs) $(empth_lib)
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
-$(client): $(filter src/client/%, $(obj)) src/lib/global/version.o src/lib/w32/getopt.o
+$(client): $(filter src/client/%, $(obj)) src/lib/global/version.o
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
+ifeq ($(empthread),Windows)
+$(client): src/lib/w32/getopt.o
+endif
$(util): $(libs)
# Info formatting
-subjects.mk: $(tsrc) info/findsubj.pl sources.mk
- perl $(srcdir)/info/findsubj.pl
-# If sources.mk is out of date, $(tsrc) is. If it contains files that
-# went away, make can't remake subjects.mk. Tell it to ignore such
-# missing files:
-$(tsrc):
+# FIXME Remaking subjects doesn't work correctly when info sources get
+# removed or subjects get dropped.
+
+subjects.mk: info/findsubj.pl $(tsrc)
+ perl $(srcdir)/info/findsubj.pl $(filter %.t, $^)
$(tsubj): info/mksubj.pl
perl $(srcdir)/info/mksubj.pl $@ $(filter %.t, $^)
# List of source files
-ifeq ($(cvs_controlled),yes)
-# Find files and directories under CVS control
-sources.mk: $(scripts)/cvsfiles.awk $(addprefix $(srcdir)/, $(addsuffix CVS/Entries, $(dirs)))
- echo 'src := ' `cd $(srcdir) && $(AWK) -f src/scripts/cvsfiles.awk | LC_ALL=C sort` >$@
+# Note: $(srcdir)/sources.mk is only used when the source tree came
+# from a tarball rather than git. The following rules create a
+# sources.mk to put into the tarball. It is not used in this build.
+
+ifeq ($(revctrl),git)
+sources.mk:
+ echo "src := $(src)" >sources.mk
else
ifneq ($(srcdir),.)
sources.mk: $(srcdir)/sources.mk