-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
65 lines (53 loc) · 1.79 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
58
59
60
61
62
63
64
65
# some binaries
XARGS := xargs
FIND := find
# for installation
base := fkmlandunter
PREFIX ?= /usr/local
# global flags
CFLAGS = -g -Wall -ansi
SRCDIR := .
VPATH := $(SRCDIR)
# each module will add to this
targets :=
tests :=
objs :=
all:
# include module descriptions
modules := server clients testenv check
include $(patsubst %,$(SRCDIR)/%/module.mk,$(modules))
# go
all: $(targets) $(tests)
check: all
$(tests)
install: all
# binaries
mkdir -p $(DESTDIR)/$(PREFIX)/bin
# servers
install -s -m 755 server/new/server $(DESTDIR)/$(PREFIX)/bin/$(base)_srv_new
install -s -m 755 server/old/server $(DESTDIR)/$(PREFIX)/bin/$(base)_srv_old
# clients
install -m 755 clients/pyqt/client.py $(DESTDIR)/$(PREFIX)/bin/$(base)_client_py
install -s -m 755 clients/curses/client $(DESTDIR)/$(PREFIX)/bin/$(base)_client_curses
install -s -m 755 clients/sdl/client $(DESTDIR)/$(PREFIX)/bin/$(base)_client_sdl
# links
ln -s $(DESTDIR)/$(PREFIX)/bin/$(base)_srv_new $(DESTDIR)/$(PREFIX)/bin/$(base)_srv
ln -s $(DESTDIR)/$(PREFIX)/bin/$(base)_client_sdl $(DESTDIR)/$(PREFIX)/bin/$(base)
#
# data
mkdir -p $(DESTDIR)/$(PREFIX)/share/fkmlandunter
cp -r data/fkmlu $(DESTDIR)/$(PREFIX)/share/fkmlandunter/data
cp clients/sdl/example.fkmlandunterrc $(DESTDIR)/$(PREFIX)/share/fkmlandunter/data
archive:
git archive --format=tar --prefix=fkmlandunter/ HEAD | gzip >fkmlandunter-latest.tar.gz
clean:
@# sort is just for removing duplicates, to shorten the command line
@echo $(sort $(objs)) $(targets) $(tests) | fmt | sed 's/^/ RM /'
@$(RM) $(sort $(objs)) $(targets) $(tests)
# Be REALLY careful with this!!
terror:
$(FIND) . -name \*.o | $(XARGS) $(RM)
%.o: %.c
@if [ ! -d `dirname $@` ]; then mkdir -p `dirname $@`; fi
@echo " CC " $@
@$(COMPILE.c) $< -o $@