forked from Vidal322/rc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (38 loc) · 860 Bytes
/
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
49
# Makefile to build the project
# NOTE: This file must not be changed.
# Parameters
CC = gcc
#CFLAGS = -Wall
CFLAGS = -w
SRC = src/
INCLUDE = include/
BIN = bin/
CABLE_DIR = cable/
TX_SERIAL_PORT = /dev/ttyS10
RX_SERIAL_PORT = /dev/ttyS11
TX_FILE = penguin.gif
RX_FILE = penguin-received.gif
# Targets
.PHONY: all
all: $(BIN)/main $(BIN)/cable
$(BIN)/main: main.c $(SRC)/*.c
$(CC) $(CFLAGS) -o $@ $^ -I$(INCLUDE)
$(BIN)/cable: $(CABLE_DIR)/cable.c
$(CC) $(CFLAGS) -o $@ $^
.PHONY: run_tx
run_tx: $(BIN)/main
./$(BIN)/main $(TX_SERIAL_PORT) tx $(TX_FILE)
.PHONY: run_rx
run_rx: $(BIN)/main
./$(BIN)/main $(RX_SERIAL_PORT) rx $(RX_FILE)
.PHONY: run_cable
run_cable: $(BIN)/cable
./$(BIN)/cable
.PHONY: check_files
check_files:
diff -s $(TX_FILE) $(RX_FILE) || exit 0
.PHONY: clean
clean:
rm -f $(BIN)/main
rm -f $(BIN)/cable
rm -f $(RX_FILE)