2f875482aea04bc803b1bbb36624914a197af4b9
[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         @echo "[LD] $@"
27         @$(CC) $(CFLAGS) $< $(LIBRARIES) -o $@
28
29 %/main.o: %/main.c Makefile ../Makefile.inc
30         @echo "[CC] $<"
31         @$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
32
33
34 #
35 # Phony Targets
36 #
37
38 .PHONY: all all-before clean samples
39
40 all-before:
41         @mkdir -p ../build/samples
42
43 clean:
44         rm -f $(SMPLOBJ) $(SMPLS)