Skip to content
Snippets Groups Projects
Commit e14d240d authored by Leon Ryuwoon Jung's avatar Leon Ryuwoon Jung
Browse files

Standardize folder structure of c, c++, ROS and Arduino - c ver in progress

parent a1f84804
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 55 deletions
......@@ -4,9 +4,10 @@
-
* Standardizes folder structure of c, c++, ROS and Arduino c++ languages
* Fixes : Inconvenient way of getting meaning of packet result and error value #67
* Fixes : Misleading indentation warning in group_sync_read.c #91
* Standardize folder structure of c++, ROS and Arduino
* Alternative : Include port_handler.h through relative path. #90
==============================================
Dynamixel SDK 3.4.6 (Protocol 1.0/2.0)
......
......@@ -38,7 +38,7 @@ CX = g++
CCFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
CXFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
FORMAT = -m32
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
#---------------------------------------------------------------------
# Required external libraries
......@@ -56,7 +56,7 @@ SOURCES = src/dynamixel_sdk/group_bulk_read.c \
src/dynamixel_sdk/port_handler.c \
src/dynamixel_sdk/protocol1_packet_handler.c \
src/dynamixel_sdk/protocol2_packet_handler.c \
src/dynamixel_sdk_linux/port_handler_linux.c \
src/dynamixel_sdk/port_handler_linux.c \
OBJECTS=$(addsuffix .o,$(addprefix $(DIR_OBJS)/,$(basename $(notdir $(SOURCES)))))
......@@ -83,8 +83,8 @@ install: $(TARGET)
-$(SYMLINK) "$(INSTALL_ROOT)/lib/$(TARGET)" "$(INSTALL_ROOT)/lib/$(TARGET3)"
# copy the headers into the include directory
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include || $(MKDIR) $(INSTALL_ROOT)/include
$(CP_ALL) $(DIR_DXL)/include/* $(INSTALL_ROOT)/include/
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include/dynamixel_sdk || $(MKDIR) $(INSTALL_ROOT)/include/dynamixel_sdk
$(CP_ALL) $(DIR_DXL)/include/dynamixel_sdk/* $(INSTALL_ROOT)/include/dynamixel_sdk/
$(LD_CONFIG)
......@@ -94,8 +94,8 @@ uninstall:
$(RM) $(INSTALL_ROOT)/lib/$(TARGET2)
$(RM) $(INSTALL_ROOT)/lib/$(TARGET3)
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk*
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk/*
reinstall: uninstall install
......@@ -110,10 +110,10 @@ $(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(CC) $(CCFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.cpp
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
#---------------------------------------------------------------------
......
......@@ -38,7 +38,7 @@ CX = g++
CCFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
CXFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) $(FORMAT) -fPIC -g
FORMAT = -m64
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
#---------------------------------------------------------------------
# Required external libraries
......@@ -83,8 +83,8 @@ install: $(TARGET)
-$(SYMLINK) "$(INSTALL_ROOT)/lib/$(TARGET)" "$(INSTALL_ROOT)/lib/$(TARGET3)"
# copy the headers into the include directory
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include || $(MKDIR) $(INSTALL_ROOT)/include
$(CP_ALL) $(DIR_DXL)/include/* $(INSTALL_ROOT)/include/
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include/dynamixel_sdk || $(MKDIR) $(INSTALL_ROOT)/include/dynamixel_sdk
$(CP_ALL) $(DIR_DXL)/include/dynamixel_sdk/* $(INSTALL_ROOT)/include/dynamixel_sdk/
$(LD_CONFIG)
......@@ -94,8 +94,8 @@ uninstall:
$(RM) $(INSTALL_ROOT)/lib/$(TARGET2)
$(RM) $(INSTALL_ROOT)/lib/$(TARGET3)
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk*
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk/*
reinstall: uninstall install
......@@ -110,10 +110,10 @@ $(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(CC) $(CCFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.cpp
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
#---------------------------------------------------------------------
......
......@@ -37,7 +37,7 @@ CC = gcc
CX = g++
CCFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) -fPIC -g
CXFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall -c $(INCLUDES) -fPIC -g
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
#---------------------------------------------------------------------
# Required external libraries
......@@ -82,8 +82,8 @@ install: $(TARGET)
-$(SYMLINK) "$(INSTALL_ROOT)/lib/$(TARGET)" "$(INSTALL_ROOT)/lib/$(TARGET3)"
# copy the headers into the include directory
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include || $(MKDIR) $(INSTALL_ROOT)/include
$(CP_ALL) $(DIR_DXL)/include/* $(INSTALL_ROOT)/include/
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/include/dynamixel_sdk || $(MKDIR) $(INSTALL_ROOT)/include/dynamixel_sdk
$(CP_ALL) $(DIR_DXL)/include/dynamixel_sdk/* $(INSTALL_ROOT)/include/dynamixel_sdk/
$(LD_CONFIG)
......@@ -93,8 +93,8 @@ uninstall:
$(RM) $(INSTALL_ROOT)/lib/$(TARGET2)
$(RM) $(INSTALL_ROOT)/lib/$(TARGET3)
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk*
$(RM) $(INSTALL_ROOT)/include/dynamixel_sdk/dynamixel_sdk.h
$(RM_ALL) $(INSTALL_ROOT)/include/dynamixel_sdk/*
reinstall: uninstall install
......@@ -109,10 +109,10 @@ $(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.c
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.c
$(CC) $(CCFLAGS) -c $? -o $@
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk_linux/%.cpp
$(DIR_OBJS)/%.o: $(DIR_DXL)/src/dynamixel_sdk/%.cpp
$(CX) $(CXFLAGS) -c $? -o $@
#---------------------------------------------------------------------
......
......@@ -26,7 +26,7 @@
TARGET = dxl_monitor
# important directories used by assorted rules and other variables
DIR_DXL = ../..
DIR_DXL = ../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = dxl_monitor
# important directories used by assorted rules and other variables
DIR_DXL = ../..
DIR_DXL = ../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m64
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x64_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = dxl_monitor
# important directories used by assorted rules and other variables
DIR_DXL = ../..
DIR_DXL = ../../..
DIR_OBJS = .objects
# compiler options
......@@ -40,7 +40,7 @@ LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_sbc_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = bulk_read
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = bulk_read
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m64
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x64_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = bulk_read
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -40,7 +40,7 @@ LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_sbc_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = multi_port
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = multi_port
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m64
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x64_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = multi_port
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -40,7 +40,7 @@ LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_sbc_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = ping
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = ping
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m64
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x64_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = ping
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -40,7 +40,7 @@ LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_sbc_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = read_write
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = read_write
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m64
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x64_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = read_write
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -40,7 +40,7 @@ LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_sbc_c
LIBRARIES += -lrt
......
......@@ -26,7 +26,7 @@
TARGET = reset
# important directories used by assorted rules and other variables
DIR_DXL = ../../..
DIR_DXL = ../../../..
DIR_OBJS = .objects
# compiler options
......@@ -41,7 +41,7 @@ FORMAT = -m32
#---------------------------------------------------------------------
# Core components (all of these are likely going to be needed)
#---------------------------------------------------------------------
INCLUDES += -I$(DIR_DXL)/include
INCLUDES += -I$(DIR_DXL)/include/dynamixel_sdk
LIBRARIES += -ldxl_x86_c
LIBRARIES += -lrt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment