improve VERBOSE handling
[olsrd.git] / lib / pud / nmealib / samples / Makefile
1 include ../Makefile.inc
2
3 #
4 # Settings
5 #
6
7 SAMPLES = generate generator math parse parse_file
8 SMPLS = $(SAMPLES:%=../build/samples/%)
9 SMPLOBJ = $(SAMPLES:%=%/main.o)
10
11 LIBRARIES = -lm -L../lib -lnmea
12 INCLUDES = -I ../include
13
14
15 #
16 # Targets
17 #
18
19 all: all-before samples
20
21 remake: clean all
22
23 samples: $(SMPLS)
24
25 ../build/samples/%: %/main.o
26 ifeq ($(VERBOSE),0)
27         @echo "[LD] $@"
28 endif
29         $(MAKECMDPREFIX)$(CC) $(CFLAGS) $< $(LIBRARIES) -o $@
30
31 %/main.o: %/main.c Makefile ../Makefile.inc
32 ifeq ($(VERBOSE),0)
33         @echo "[CC] $<"
34 endif
35         $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
36
37
38 #
39 # Phony Targets
40 #
41
42 .PHONY: all all-before clean samples
43
44 all-before:
45         $(MAKECMDPREFIX)mkdir -p ../build/samples
46
47 clean:
48         $(MAKECMDPREFIX)rm -f $(SMPLOBJ) $(SMPLS)