From f0eba93472e0afecc57180fc0d638eeef8e6f3c6 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 6 Jan 2022 18:14:30 +0200 Subject: Added lint rule to Makefile + Runs a syntax check on all files of the selected arch --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index adcb405..2bcef0f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ DO != echo > deps.mk # this could be done better DEBUGFLAGS != [ $(RELEASE) ] && echo "-flto -O2" || echo "-O0 -ggdb3 -DDEBUG" CFLAGS = -fno-pie -ffreestanding -nostdlib -std=c17 -Wall -Wextra +LINTFLAGS = -fsyntax-only DEPFLAGS = -MT $@ -MMD -MP -MF $@.d all: apos.bin @@ -33,6 +34,9 @@ INCLUDE_FLAGS := -I include -I arch/$(ARCH)/include\ COMPILE = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\ $(CFLAGS) $(ARCH_FLAGS) $(DEPFLAGS) $(INCLUDE_FLAGS) +LINT = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\ + $(CFLAGS) $(ARCH_FLAGS) $(LINTFLAGS) $(INCLUDE_FLAGS) + GENELF = $(CROSS_COMPILE)$(CC) $(DEBUGFLAGS)\ $(CFLAGS) $(ARCH_FLAGS) $(INCLUDE_FLAGS) @@ -53,6 +57,8 @@ include deps.mk $(INIT_LD): kernel.bin +lint: $(INIT_OBJECTS:.o=.o.l) $(KERNEL_OBJECTS:.o=.o.l) + init.elf: $(INIT_OBJECTS) $(INIT_LD) $(GENELF) -T $(INIT_LD) $(INIT_OBJECTS) -o $@ -- cgit v1.3