-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
57 lines (45 loc) · 1.94 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
CC = @CC@
datarootdir = @datarootdir@
prefix = @prefix@
CFLAGS = @CFLAGS@
OBJS = ai.o map.o character.o dice.o diplomacy.o editor.o feud.o file.o logic.o mapgen.o new.o piece.o server.o single.o time.o window.o world.o
CLI_OBJS = map.o character.o dice.o diplomacy.o file.o piece.o time.o world.o
EXECS = feud feud-editor feud-ai feud-server feud-single
DATAFILES = characters.txt regions.txt
.PHONY: all clean distclean install uninstall
all: $(EXECS)
$(OBJS): %.o: %.c
$(CC) -c $(CFLAGS) -DDATADIR=\"$(datarootdir)/feud\" $< -o $@
feud: $(CLI_OBJS) feud.o new.o mapgen.o window.o
$(CC) $(CFLAGS) -o feud $(CLI_OBJS) feud.o new.o mapgen.o window.o -lncurses -lm
feud-editor: $(CLI_OBJS) editor.o new.o mapgen.o window.o
$(CC) $(CFLAGS) -o feud-editor $(CLI_OBJS) editor.o new.o mapgen.o window.o -lncurses -lm
feud-ai: $(CLI_OBJS) ai.o logic.o
$(CC) $(CFLAGS) -o feud-ai $(CLI_OBJS) ai.o logic.o -lm
feud-server: $(CLI_OBJS) server.o
$(CC) $(CFLAGS) -o feud-server $(CLI_OBJS) server.o -lm
feud-single: $(CLI_OBJS) logic.o mapgen.o new.o single.o window.o
$(CC) $(CFLAGS) -o feud-single $(CLI_OBJS) logic.o mapgen.o new.o single.o window.o -lncurses -lm
clean:
for i in $(OBJS) $(EXECS); do \
if [ -e $$i ]; then rm -v $$i; fi; \
done
distclean: clean
rm config.log config.status Makefile
install: uninstall
if [ ! -d $(DESTDIR)$(prefix)/bin ]; then mkdir -p $(DESTDIR)$(prefix)/bin; fi
for EXEC in $(EXECS); do \
install -m 755 $$EXEC $(DESTDIR)$(prefix)/bin/$$EXEC; \
done
if [ ! -d $(DESTDIR)$(datarootdir)/feud ]; then mkdir -p $(DESTDIR)$(datarootdir)/feud; fi
for DATAFILE in $(DATAFILES); do \
install -m 644 $$DATAFILE $(DESTDIR)$(datarootdir)/feud/$$EXEC; \
done
uninstall:
for EXEC in $(EXECS); do \
if [ -e $(DESTDIR)$(prefix)/bin/$$EXEC ]; then rm $(DESTDIR)$(prefix)/bin/$$EXEC; fi; \
done
for DATAFILE in $(DATAFILES); do \
if [ -e $(DESTDIR)$(datarootdir)/feud/$$DATAFILE ]; then \
rm $(DESTDIR)$(datarootdir)/feud/$$DATAFILE; fi; \
done