-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (33 loc) · 1.05 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
# Makefile for Onkyo Receiver communication program
#CFLAGS = -Wall -Wextra -ggdb -O2 -fstrict-aliasing -march=native -std=c99 -fprofile-arcs -ftest-coverage
CFLAGS = -Wall -Wextra -ggdb -O2 -fstrict-aliasing -flto -march=native -std=c99
LDFLAGS = -Wl,-O1,--as-needed -ggdb -O2 -fstrict-aliasing -march=native -std=c99 -fwhole-program
program = onkyocontrol
objects = command.o onkyo.o receiver.o util.o
asm = command.s onkyo.s receiver.s util.s
.PHONY: all clean doc
all: $(program)
asm: $(asm)
clean:
rm -f $(program) $(program).exe
rm -f $(objects)
rm -f $(asm)
rm -rf doc
$(program): $(objects)
@rm -f $(program)
$(CC) $(objects) $(LDFLAGS) -o $(program)
%.s : %.c
$(CC) -S $(CFLAGS) $(CPPFLAGS) $< -o $@
command.o: Makefile command.c onkyo.h
receiver.o: Makefile receiver.c onkyo.h
onkyo.o: Makefile onkyo.c onkyo.h
util.o: Makefile util.c onkyo.h
doc:
mkdir -p doc
doxygen
install: $(program)
install -m755 $(program) /usr/bin/
install -m755 frontend.py /usr/bin/onkyo-frontend
uninstall:
rm -f /usr/bin/$(program)
rm -rf /usr/bin/onkyo-frontend