add makefile for project ADIS_Raspi_UDP

main
Simon Frei 4 years ago
parent fc2cb653fa
commit 62112d298b
  1. 56
      ADIS_Raspi_UDP/makefile

@ -0,0 +1,56 @@
default: all
CC = arm-linux-gnueabihf-g++ -ggdb
LINK_TARGET = $(OBJ_DIR)udp_app
DEPEND_OPTS = -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -MT"$(@:%.o=%.d)"
SRC_DIR = ./src/
OBJ_DIR = ./obj/
OBJS = \
$(OBJ_DIR)delay.o \
$(OBJ_DIR)platform.o \
$(OBJ_DIR)gpio.o \
$(OBJ_DIR)robotNav.o \
$(OBJ_DIR)udp.o \
$(OBJ_DIR)hostname.o \
$(OBJ_DIR)main.o
############################
# List of dependency files
C_DEPS = \
$(OBJ_DIR)delay.d \
$(OBJ_DIR)platform.d \
$(OBJ_DIR)gpio.d \
$(OBJ_DIR)robotNav.d \
$(OBJ_DIR)udp.d \
$(OBJ_DIR)hostname.d \
$(OBJ_DIR)main.d
############################
# Include generated dependency files (only if not clean target)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
all: $(LINK_TARGET)
@echo All done!
clean:
-@rm $(LINK_TARGET)
-@rm $(OBJS)
-@rm $(C_DEPS)
@echo Clean done!
############################
# Pattern rule to compile a file
# $@ matches the target
# $< matches the first dependent
$(OBJ_DIR)%.o: $(SRC_DIR)%.c
$(CC) $(DEPEND_OPTS) -g3 -c "$<" -o "$@"
$(LINK_TARGET): $(OBJS)
$(CC) $(OBJS) -ggdb -o $@
# -lgpiod
# if gpiod not found:
# sudo apt install libgpiod
# sudo apt install libgpiod-dev
Loading…
Cancel
Save