blob: 1cddf524f0bb35671119b22df0892a0acc78a54b [file] [log] [blame]
Shinichiro Hamaji10c01062015-04-03 16:14:32 +09001test1:
2 touch server.c server_priv.c server_access.c
3 touch client.c client_api.c client_mem.c
4
5test2: all
6
7PROGRAMS = server client
8
9server_OBJS = server.o server_priv.o server_access.o
Shinichiro Hamaji10c01062015-04-03 16:14:32 +090010
11client_OBJS = client.o client_api.o client_mem.o
Shinichiro Hamaji10c01062015-04-03 16:14:32 +090012
13# Everything after this is generic
14
15.PHONY: all
16all: $(PROGRAMS)
17
Shinichiro Hamaji8c75f0b2015-04-03 16:35:21 +090018define PROGRAM_template
19 $(1): $$($(1)_OBJS)
Shinichiro Hamaji10c01062015-04-03 16:14:32 +090020 ALL_OBJS += $$($(1)_OBJS)
21endef
22
23$(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))
24
25$(PROGRAMS):
Shinichiro Hamaji8c75f0b2015-04-03 16:35:21 +090026 echo $^ -o $@
Shinichiro Hamaji10c01062015-04-03 16:14:32 +090027
28clean:
29 rm -f $(ALL_OBJS) $(PROGRAMS)