ac := $(srcdir)/autom4te.cache config.h config.log config.status \
stamp-h $(basename $(filter %.in, $(src)))
acdist := aclocal.m4 config.h.in configure stamp-h.in
+acdistcli := $(addprefix src/client/, aclocal.m4 config.h.in configure)
obj := $(csrc:.c=.o) $(filter %.o, $(ac:.c=.o))
# TODO AIX needs lwpInit.o lwpRestore.o lwpSave.o unless UCONTEXT
deps := $(obj:.o=.d)
$(ttop) $(info.nr) $(info.html) $(empth_obj) $(empth_lib)
# Removed by distclean:
distclean := $(ac)
-# Distributed by dist from $(srcdir)
+# Distributed by dist-source from $(srcdir)
src_distgen := $(acdist)
-# Distributed by dist from .
+# Distributed by dist-source from .
bld_distgen := $(mk)
+# Distributed by dist-client from $(srcdir)/src/client
+cli_distgen := $(acdistcli)
# Compiler flags
CPPFLAGS += -I$(srcdir)/include -I.
### Explicit rules
+# Compilation
+
$(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 $@
$(AR) rc $@ $?
$(RANLIB) $@
+# 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
echo 'src := ' `cd $(srcdir) && $(AWK) -f src/scripts/cvsfiles.awk` >$@
endif
+#
.PHONY: dist-source
-dist-source: check-version
+dist-source: check-version $(src_distgen) $(bld_distgen)
$(tarball) $(TARNAME)-$(VERSION) $(bld_distgen) -C $(srcdir) $(src_distgen) $(src)
.PHONY: dist-client
-dist-client:
- $(tarball) $(TARNAME)-client-$(VERSION) \
- -C $(srcdir)/src/client $(notdir $(filter src/client/%, $(src))) \
- -C $(srcdir)/include proto.h \
- -C $(srcdir)/man empire.6
+dist-client: $(cli_distgen)
+ $(tarball) $(TARNAME)-client-$(VERSION) \
+ -C $(srcdir)/src/client \
+ $(notdir $(filter src/client/%, $(src)) $(cli_distgen)) \
+ -C $(srcdir)/include proto.h \
+ -C $(srcdir)/man empire.6 \
+ -C $(srcdir) COPYING INSTALL install-sh
.PHONY: dist-info
dist-info: info html
-include $(deps)
endif
+
# Automatic remake of configuration
# See (autoconf)Automatic Remaking.
# This requires sufficiently recent versions of autoconf and automake
src/lib/global/path.c src/client/ipglob.c: %: %.in GNUmakefile
$(subst.in) <$< >$@
+
+
+# Make files for standalone client distribution
+
+$(srcdir)/src/client/configure: src/client/configure.ac src/client/aclocal.m4
+ cd $(dir $@) && autoconf
+
+$(srcdir)/src/client/config.h.in: src/client/configure.ac src/client/aclocal.m4
+ cd $(dir $@) && autoheader
+ touch $@
+
+$(srcdir)/src/client/aclocal.m4: m4/lib_socket_nsl.m4
+ cp -f $< $@