forked from CANopenNode/CANopenNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (36 loc) · 1.24 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
49
50
51
52
# Makefile for CANopenNode, basic compile with no CAN device.
STACKDRV_SRC = stack/drvTemplate
STACK_SRC = stack
CANOPEN_SRC = .
APPL_SRC = example
LINK_TARGET = canopennode
INCLUDE_DIRS = -I$(STACKDRV_SRC) \
-I$(STACK_SRC) \
-I$(CANOPEN_SRC) \
-I$(APPL_SRC)
SOURCES = $(STACKDRV_SRC)/CO_driver.c \
$(STACKDRV_SRC)/eeprom.c \
$(STACK_SRC)/crc16-ccitt.c \
$(STACK_SRC)/CO_SDO.c \
$(STACK_SRC)/CO_Emergency.c \
$(STACK_SRC)/CO_NMT_Heartbeat.c \
$(STACK_SRC)/CO_SYNC.c \
$(STACK_SRC)/CO_PDO.c \
$(STACK_SRC)/CO_HBconsumer.c \
$(STACK_SRC)/CO_SDOmaster.c \
$(STACK_SRC)/CO_trace.c \
$(CANOPEN_SRC)/CANopen.c \
$(APPL_SRC)/CO_OD.c \
$(APPL_SRC)/main.c
OBJS = $(SOURCES:%.c=%.o)
CC = gcc
CFLAGS = -Wall $(INCLUDE_DIRS)
LDFLAGS =
.PHONY: all clean
all: clean $(LINK_TARGET)
clean:
rm -f $(OBJS) $(LINK_TARGET)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(LINK_TARGET): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@