blob: e4dc49a57190006b88f005a52a73679453d7d1ff [file] [log] [blame]
Shinichiro Hamaji10c01062015-04-03 16:14:32 +09001# TODO(hamaji)
2
3test1:
4 touch server.c server_priv.c server_access.c
5 touch client.c client_api.c client_mem.c
6
7test2: all
8
9PROGRAMS = server client
10
11server_OBJS = server.o server_priv.o server_access.o
12server_LIBS = priv protocol
13
14client_OBJS = client.o client_api.o client_mem.o
15client_LIBS = protocol
16
17# Everything after this is generic
18
19.PHONY: all
20all: $(PROGRAMS)
21
22define PROGRAM_template =
23 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
24 ALL_OBJS += $$($(1)_OBJS)
25endef
26
27$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
28
29$(PROGRAMS):
30 $(LINK.o) $^ $(LDLIBS) -o $@
31
32clean:
33 rm -f $(ALL_OBJS) $(PROGRAMS)