From 62112d298b8c1e89385f4ed5eb3d3e308772f792 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 10 Nov 2022 13:50:49 +0100 Subject: [PATCH] add makefile for project ADIS_Raspi_UDP --- ADIS_Raspi_UDP/makefile | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ADIS_Raspi_UDP/makefile diff --git a/ADIS_Raspi_UDP/makefile b/ADIS_Raspi_UDP/makefile new file mode 100644 index 0000000..5b99bc6 --- /dev/null +++ b/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