aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
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 $@