-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
790 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
CANARD_BASE=../.. | ||
|
||
CC=gcc | ||
CFLAGS = -g -Wall -Idsdl_generated/include -I$(CANARD_BASE) -I$(CANARD_BASE)/drivers/linux | ||
|
||
LIBS=$(CANARD_BASE)/canard.c -lm | ||
|
||
# add socketcan and multicast drivers for linux | ||
LIBS+=$(CANARD_BASE)/drivers/socketcan/socketcan.c | ||
LIBS+=$(CANARD_BASE)/drivers/mcast/mcast.c | ||
LIBS+=$(CANARD_BASE)/drivers/linux/linux.c | ||
|
||
# add in generated code | ||
LIBS+=dsdl_generated/src/uavcan.protocol.NodeStatus.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.GetNodeInfo_res.c | ||
LIBS+=dsdl_generated/src/uavcan.equipment.range_sensor.Measurement.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.dynamic_node_id.Allocation.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.param.GetSet_req.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.param.GetSet_res.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.param.ExecuteOpcode_req.c | ||
LIBS+=dsdl_generated/src/uavcan.protocol.param.ExecuteOpcode_res.c | ||
|
||
all: rangefinder | ||
|
||
DSDL: | ||
git clone --depth 1 https://github.com/DroneCAN/DSDL | ||
|
||
dronecan_dsdlc: | ||
git clone --depth 1 https://github.com/DroneCAN/dronecan_dsdlc | ||
|
||
dsdl_generated: DSDL dronecan_dsdlc | ||
python3 dronecan_dsdlc/dronecan_dsdlc.py -O dsdl_generated DSDL/dronecan DSDL/uavcan DSDL/com DSDL/ardupilot | ||
|
||
rangefinder: dsdl_generated rangefinder.c $(LIBS) | ||
$(CC) -o rangefinder rangefinder.c $(LIBS) $(CFLAGS) | ||
|
||
clean: | ||
rm -rf rangefinder DSDL dsdl_generated dronecan_dsdlc |
Oops, something went wrong.