forked from CANopenNode/CANopenNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (33 loc) · 1.14 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 CANopenNode, basic compile with no CAN device.
STACK_SRC = stack
STACKDRV_SRC = stack/drvTemplate
CANOPEN_SRC = .
APPL_SRC = example
INCLUDE_DIRS = $(CANOPEN_SRC) \
-I$(STACK_SRC) \
-I$(STACKDRV_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 \
$(CANOPEN_SRC)/CANopen.c \
$(APPL_SRC)/CO_OD.c \
$(APPL_SRC)/main.c
OBJS = ${SOURCES:%.c=%.o}
CC = gcc
CFLAGS = -Wall -I$(INCLUDE_DIRS)
.PHONY: all clean
all: canopennode
clean:
rm -f $(OBJS) canopennode
%.o: %.c
$(CC) $(CFLAGS) -c -o $*.o $<
canopennode: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $@