• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1target_rel_dir := $(if $(cwd_rel_from_top),$(cwd_rel_from_top)/,)
2
3%.o: %.c
4ifdef VERBOSE
5	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
6else
7	@$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
8	@echo CC $(target_rel_dir)$@
9endif
10
11ifdef VERBOSE
12COMPILE.c=$(CC) $(CPPFLAGS) $(CFLAGS) -c
13else
14COMPILE.c=@echo CC $(target_rel_dir)$@; $(CC) $(CPPFLAGS) $(CFLAGS) -c
15endif
16
17%: %.o
18ifdef VERBOSE
19	$(CC) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@
20else
21	@$(CC) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@
22	@echo LD $(target_rel_dir)$@
23endif
24
25$(HOST_MAKE_TARGETS): %: %.c
26ifdef VERBOSE
27	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $< $(HOST_LDLIBS) -o $@
28else
29	@$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) $< $(HOST_LDLIBS) -o $@
30	@echo HOSTCC $(target_rel_dir)$@
31endif
32
33%: %.c
34ifdef VERBOSE
35	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@
36else
37	@$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LTPLDLIBS) $(LDLIBS) -o $@
38	@echo CC $(target_rel_dir)$@
39endif
40
41.PHONY: $(CHECK_TARGETS)
42$(CHECK_TARGETS): check-%: %.c
43ifdef VERBOSE
44	-$(CHECK_NOFLAGS) $<
45	-$(CHECK) $(CHECK_FLAGS) $(CPPFLAGS) $(CFLAGS) $<
46else
47	@echo CHECK $(target_rel_dir)$<
48	@-$(CHECK_NOFLAGS) $<
49	@-$(CHECK) $(CHECK_FLAGS) $(CPPFLAGS) $(CFLAGS) $<
50endif
51
52.PHONY: $(SHELL_CHECK_TARGETS)
53$(SHELL_CHECK_TARGETS): check-%.sh: %.sh
54ifdef VERBOSE
55	-$(SHELL_CHECK) $<
56else
57	@echo CHECK $(target_rel_dir)$<
58	@-$(SHELL_CHECK) $<
59endif
60