forked from theZiz/ev3c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 1.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CFLAGS = -O3
ifndef RANLIB
RANLIB = ranlib
endif
all: lib/ev3c.a bin/test_sensor bin/test_motor bin/test_lcd bin/test_button bin/test_led bin/test_battery
obj/%.o: %.c %.h ev3c.h Makefile
mkdir -p $(@D)
$(CC) -c -o $@ $< $(CFLAGS)
lib/ev3c.a: obj/ev3c_core.o obj/ev3c_lcd.o obj/ev3c_sensor.o obj/ev3c_motor.o obj/ev3c_button.o obj/ev3c_led.o obj/ev3c_battery.o
mkdir -p $(@D)
$(AR) rc $@ $^ && $(RANLIB) $@
bin/test_sensor: test_sensor.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
bin/test_motor: test_motor.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
bin/test_lcd: test_lcd.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
bin/test_button: test_button.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
bin/test_led: test_led.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
bin/test_battery: test_battery.c lib/ev3c.a
mkdir -p $(@D)
$(CC) -o $@ $< lib/ev3c.a $(CFLAGS)
documentation: *.h
mkdir -p /tmp/ev3DocumentationTemp
naturaldocs -i . -xi ./ev3c_documentation -o HTML ev3c_documentation -p /tmp/ev3DocumentationTemp
.PHONY: all clean
clean:
rm -rf obj lib bin
rm -f *~