aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f599801e8b933d413d5db1356c9331186273067f (plain) (blame)
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
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without any warranty.


# Include configurations.
include mk/config.mk


# Object files for the libary.
LIBOBJ = linked-list client-list hash-table fd-table mds-message util

# Servers and utilities.
SERVERS = mds mds-respawn mds-server mds-echo mds-registry mds-clipboard  \
          mds-kkbd mds-vt

# Utilities that do not utilise mds-base.
TOOLS = mds-kbdc

# Servers that need setuid and root owner.
SETUID_SERVERS = mds mds-kkbd mds-vt



OBJ_mds-server_ = mds-server interception-condition client multicast  \
                  queued-interception globals signals interceptors    \
                  sending slavery reexec receiving

OBJ_mds-registry_ = mds-registry util globals reexec registry signals  \
                    slave

OBJ_mds-server   = $(foreach O,$(OBJ_mds-server_),obj/mds-server/$(O).o)
OBJ_mds-registry = $(foreach O,$(OBJ_mds-registry_),obj/mds-registry/$(O).o)

ifneq ($(LIBMDSSERVER_IS_INSTALLED),y)
SEDED = src/libmdsserver/config.h
else
SEDED =
endif



# Build rules.

.PHONY: all
all: doc servers libraries tools

include mk/build.mk
include mk/build-doc.mk

# Set permissions on built files.

.PHONY: perms
perms: all
	sudo chown 'root:root' $(foreach S,$(SETUID_SERVERS),bin/$(S))
	sudo chmod 4755 $(foreach S,$(SETUID_SERVERS),bin/$(S))

# Clean rules.

.PHONY: clean
clean:
	-rm -rf obj bin $(SEDED)