$(server): $(filter src/server/% src/lib/commands/% src/lib/player/% src/lib/subs/% src/lib/update/%, $(obj)) $(empth_obj) $(empth_lib) $(libs)
$(call quiet-command,$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@,LINK $@)
-$(client): $(filter src/client/%, $(obj)) src/lib/global/version.o
+$(client): $(filter src/client/%, $(obj)) src/lib/global/version.o src/lib/gen/fnameat.o
$(call quiet-command,$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@,LINK $@)
$(util): $(libs)
$(tarball) $(TARNAME)-client-$(VERSION) \
-C $(srcdir)/src/client \
$(notdir $(filter src/client/%, $(src)) $(cli_distgen)) \
- -C $(srcdir)/include proto.h version.h \
+ -C $(srcdir)/include fnameat.h proto.h version.h \
-C $(srcdir)/src/lib/global version.c \
+ -C $(srcdir)/src/lib/gen fnameat.c \
-C $(srcdir)/src/lib $(addprefix w32/, $(client/w32)) \
-C $(srcdir)/man empire.6 \
-C $(srcdir)/build-aux install-sh \
# Makefile.in: Makefile template for configure
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2013
+# Markus Armbruster, 2005-2015
#
CC = @CC@
VPATH = @srcdir@
prog = empire$E
-obj = expect.$O host.$O ipglob.$O linebuf.$O login.$O main.$O play.$O \
-ringbuf.$O secure.$O servcmd.$O termlib.$O version.$O $(LIBOBJS)
+obj = expect.$O fnameat.$O host.$O ipglob.$O linebuf.$O login.$O \
+main.$O play.$O ringbuf.$O secure.$O servcmd.$O termlib.$O version.$O \
+$(LIBOBJS)
all: $(prog)
host.$O: misc.h
linebuf.$O: linebuf.h
login.$O: misc.h proto.h
-main.$O: misc.h version.h
+main.$O: fnameat.h misc.h version.h
play.$O: linebuf.h misc.h proto.h ringbuf.h secure.h
ringbuf.$O: ringbuf.h
secure.$O: ringbuf.h secure.h
#include <pwd.h>
#endif
#include <unistd.h>
+#include "fnameat.h"
#include "misc.h"
#include "version.h"
sock = tcp_connect(host, port);
- if (use_history_file) {
- /* FIXME don't truncate udir */
- history_file = malloc(1024);
- strncpy(history_file, udir, 1000);
- strcat(history_file, "/.empire.history");
- }
+ if (use_history_file)
+ history_file = fnameat(".empire_history", udir);
if (!login(sock, uname, country, passwd, send_kill, utf8))
exit(1);