1# SPDX-License-Identifier: GPL-2.0 2ifeq ($(strip $(V)), 1) 3 Q = 4else 5 Q = @ 6endif 7 8CFLAGS += -std=gnu99 -Wall -Wextra -g \ 9 -D_GNU_SOURCE \ 10 -Wno-unused-parameter \ 11 -Wmaybe-uninitialized \ 12 -Wredundant-decls \ 13 -Wcast-align \ 14 -Wsign-compare \ 15 -Wno-missing-field-initializers 16 17CC := $(CROSS_COMPILE)gcc 18 19TOOLS = loopback_test 20 21all: $(TOOLS) 22 23%.o: %.c ../greybus_protocols.h 24 @echo ' TARGET_CC $@' 25 $(Q)$(CC) $(CFLAGS) -c $< -o $@ 26 27loopback_%: loopback_%.o 28 @echo ' TARGET_LD $@' 29 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ 30 31clean:: 32 rm -f *.o $(TOOLS) 33