]> git.pond.sub.org Git - empserver/blobdiff - Make.mk
Improve message when refusing to load plane on unsuitable ship
[empserver] / Make.mk
diff --git a/Make.mk b/Make.mk
index 2d79ec3316450b210a801b0223014bd5acb9acf9..adaad9a9665dc06c459db3f3caa85a1cf69082ff 100644 (file)
--- a/Make.mk
+++ b/Make.mk
@@ -1,6 +1,6 @@
 #
 #   Empire - A multi-player, client/server Internet based war game.
-#   Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+#   Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
 #                            Ken Stevens, Steve McClure
 #
 #   This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@
 #   Make.mk: The real Makefile, included by GNUmakefile
 #
 #   Known contributors to this file:
-#      Markus Armbruster, 2005-2008
+#      Markus Armbruster, 2005-2009
 #
 
 # This makefile was inspired by `Recursive Make Considered Harmful',
@@ -74,6 +74,8 @@ gamedir := $(localstatedir)/empire
 builtindir := $(datadir)/empire/builtin
 einfodir := $(datadir)/empire/info.nr
 ehtmldir := $(datadir)/empire/info.html
+client/w32 := arpa/inet.h netdb.h netinet/in.h sys/time.h sys/socket.h \
+sys/uio.h unistd.h w32io.c w32sockets.c w32types.h
 
 # How to substitute Autoconf output variables
 # Recursively expanded so that $@ and $< work.
@@ -133,6 +135,7 @@ endif
 
 ifeq ($(empthread),Windows)    # really: W32, regardless of thread package
 libs += lib/libw32.a
+$(client): lib/libw32.a
 endif
 
 # Cleanliness
@@ -142,9 +145,9 @@ clean := $(obj) $(deps) $(libs) $(util) $(client) $(server) $(tsubj)        \
 $(ttop) $(info.nr) $(info.html) $(empth_obj) $(empth_lib)
 # Removed by distclean:
 distclean := $(ac) $(mk)
-# Distributed by dist-source from $(srcdir)
-src_distgen := $(acdist) sources.mk
-# Distributed by dist-client from $(srcdir)/src/client
+# Distributed by dist-source from $(srcdir):
+src_distgen := $(acdist)
+# Distributed by dist-client from $(srcdir)/src/client; removed by distclean:
 cli_distgen := $(acdistcli)
 
 # Compiler flags
@@ -159,8 +162,8 @@ CFLAGS += -Wall -W -Wno-unused-parameter -Wpointer-arith    \
 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs      \
 -Wredundant-decls
 endif
-LDLIBS += -lm
-$(client): LDLIBS += $(termlibs)
+$(client): LDLIBS := $(LIBS_client)
+$(server): LDLIBS := $(LIBS_server)
 
 ### Advertized goals
 
@@ -177,7 +180,7 @@ clean:
 
 .PHONY: distclean
 distclean: clean
-       rm -rf $(distclean)
+       rm -rf $(distclean) $(cli_distgen)
 
 .PHONY: install
 install: all installdirs
@@ -274,9 +277,6 @@ $(server): $(filter src/server/% src/lib/commands/% src/lib/player/% src/lib/sub
 
 $(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)
 
@@ -320,23 +320,14 @@ $(topics.html): info/emp2html.pl
 info.ps: info/TROFF.MAC info/INFO.MAC $(ttop) $(tsubj) $(tsrc)
        groff $^ >$@
 
-# List of source files
-
-# Note: $(srcdir)/sources.mk is only included when the source tree
-# came from a tarball rather than git.  The following rule creates a
-# it only for putting it into the tarball.  It is not used otherwise
-# in this build.
-ifeq ($(revctrl),git)
-.PHONY: $(srcdir)/sources.mk
-$(srcdir)/sources.mk:
-       echo "src := $(src)" >$@
-endif
-
 # Distributing
 
 .PHONY: dist-source
 dist-source: $(src_distgen)
-       $(tarball) $(TARNAME)-$(VERSION) -C $(srcdir) $(src_distgen) $(src)
+ifeq ($(revctrl),git)
+       echo "src := $(src)" >$(srcdir)/sources.mk
+endif
+       $(tarball) $(TARNAME)-$(VERSION) -C $(srcdir) $(src_distgen) $(src) sources.mk
 
 .PHONY: dist-client
 dist-client: $(cli_distgen)
@@ -345,7 +336,7 @@ dist-client: $(cli_distgen)
                $(notdir $(filter src/client/%, $(src)) $(cli_distgen)) \
        -C $(srcdir)/include proto.h version.h                          \
        -C $(srcdir)/src/lib/global version.c                           \
-       -C $(srcdir)/src/lib/w32 getopt.h getopt.c                      \
+       -C $(srcdir)/src/lib $(addprefix w32/, $(client/w32))           \
        -C $(srcdir)/man empire.6                                       \
        -C $(srcdir) COPYING INSTALL install-sh
 
@@ -399,5 +390,5 @@ $(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 $< $@
+$(srcdir)/src/client/aclocal.m4: m4/lib_socket_nsl.m4 m4/my_terminfo.m4 m4/my_windows_api.m4
+       cat $^ >$@