aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rwxr-xr-xscripts/gen-deps5
-rwxr-xr-xscripts/gen-padding9
3 files changed, 10 insertions, 10 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 $@
diff --git a/scripts/gen-deps b/scripts/gen-deps
index ee64022..bdc1626 100755
--- a/scripts/gen-deps
+++ b/scripts/gen-deps
@@ -1,6 +1,7 @@
#!/bin/sh
gencommon () {
+ lint="build/${s%.*}${1}.l"
dep="build/${s%.*}${1}.d"
obj="build/${s%.*}${1}"
@@ -9,7 +10,6 @@ gencommon () {
echo "${dep}:" >> deps.mk
echo "include ${dep}" >> deps.mk
echo "${obj}: ${s}" >> deps.mk
-
}
genlink () {
@@ -21,6 +21,9 @@ genlink () {
genrule () {
gencommon "${1}"
echo " \$(COMPILE) -c \$< -o \$@" >> deps.mk
+
+ echo "${lint}: ${s}" >> deps.mk
+ echo " \$(LINT) -c \$<" >> deps.mk
}
case "${1}" in
diff --git a/scripts/gen-padding b/scripts/gen-padding
deleted file mode 100755
index 22c12f9..0000000
--- a/scripts/gen-padding
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-align="$1"
-filename="$2"
-
-filesize=$(stat -c "%s" "${filename}")
-padsize=$(echo "${filesize}" | awk "{print ${align} - (\$1 % ${align})}")
-
-dd if=/dev/zero ibs=1 count="${padsize}" >> "${filename}"