#
# Empire - A multi-player, client/server Internet based war game.
-# Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
-# Ken Stevens, Steve McClure
+# Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+# Ken Stevens, Steve McClure, Markus Armbruster
#
-# This program is free software; you can redistribute it and/or modify
+# Empire is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ---
#
# Make.mk: The real Makefile, included by GNUmakefile
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2009
+# Markus Armbruster, 2005-2012
#
# This makefile was inspired by `Recursive Make Considered Harmful',
# Dependencies:
deps := $(obj:.o=.d)
# Library archives:
-libs := $(addprefix lib/, libcommon.a libas.a libgen.a libglobal.a)
+libs := $(addprefix lib/, libcommon.a libgen.a libglobal.a)
# Programs:
util := $(addprefix src/util/, $(addsuffix $(EXEEXT), empdump empsched fairland files pconfig))
client := src/client/empire$(EXEEXT)
info.nr := $(addprefix info.nr/, $(info))
info.html := $(addprefix info.html/, $(addsuffix .html, $(info)))
info.all := $(info.nr) $(info.html) info.ps
+# Tests
+# sandbox
# Conditionally generated files:
empth_obj := src/lib/empthread/io.o
# Each generated file should be in one of the following sets.
# Removed by clean:
clean := $(obj) $(deps) $(libs) $(util) $(client) $(server) $(tsubj) \
-$(ttop) $(info.all) $(empth_obj) $(empth_lib)
+$(ttop) $(info.all) $(empth_obj) $(empth_lib) sandbox
# Removed by distclean:
distclean := $(ac) $(mk)
# Distributed by dist-source from $(srcdir):
$(client): LDLIBS := $(LIBS_client)
$(server): LDLIBS := $(LIBS_server)
+# Self-tests
+checks := check-smoke
+
+
### Advertized goals
.PHONY: all
.PHONY: clean
clean:
- $(call quiet-command,rm -f $(clean),CLEAN)
+ $(call quiet-command,rm -rf $(clean),CLEAN)
.PHONY: distclean
distclean: clean
.PHONY: dist
dist: dist-source dist-client dist-info
+.PHONY: check $(checks)
+check: $(checks)
+$(checks): all
+check-smoke:
+ @echo "Warning: smoke test is immature and needs work." >&2
+ $(srcdir)/tests/files-test $(srcdir)
+ $(srcdir)/tests/fairland-test $(srcdir)
+ifeq ($(empthread),LWP)
+ $(srcdir)/tests/smoke-test $(srcdir)
+else
+ @echo "$(srcdir)/tests/smoke-test SKIPPED"
+endif
+
### Implicit rules
$(util): $(libs)
-lib/libas.a: $(filter src/lib/as/%, $(obj))
lib/libcommon.a: $(filter src/lib/common/%, $(obj))
lib/libgen.a: $(filter src/lib/gen/%, $(obj))
lib/libglobal.a: $(filter src/lib/global/%, $(obj))
$(tarball) $(TARNAME)-info-text-$(VERSION) -C info.nr $(info)
$(tarball) $(TARNAME)-info-html-$(VERSION) -C info.html $(addsuffix .html, $(info))
+# Dependencies
+
ifneq ($(deps),)
-include $(deps)
endif