summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--arch/x86/machine/pmap.c2
-rw-r--r--kern/console.c1
-rw-r--r--kern/init.c1
-rw-r--r--kern/printf.c2
-rw-r--r--kern/sref.c1
-rw-r--r--kern/work.c1
-rw-r--r--vm/vm_page.c2
8 files changed, 19 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5371c7a..a324fae 100644
--- a/Makefile
+++ b/Makefile
@@ -71,9 +71,16 @@ define xbuild_compile
$(COMPILE) -MMD -MP -c -o $@ $<
endef
+# $(call xbuild_gen_linker_script_depfile,<linker_script>)
+define xbuild_gen_linker_script_depfile
+$(call xbuild_replace_source_suffix,d,$(1))
+endef
+
define xbuild_gen_linker_script
$(call xbuild_action,LDS,$@) \
- $(CPP) $(XBUILD_CPPFLAGS) -P -o $@ $<
+ $(CPP) $(XBUILD_CPPFLAGS) -MMD -MP \
+ -MF $(call xbuild_gen_linker_script_depfile,$<) \
+ -MT $@ -P -o $@ $<
endef
# $(call xbuild_link,<objects>)
@@ -281,6 +288,7 @@ COMPILE := $(CC) $(XBUILD_CPPFLAGS) $(XBUILD_CFLAGS)
x15_SOURCES := $(x15_SOURCES-y)
x15_OBJDEPS := $(call xbuild_replace_source_suffix,d,$(x15_SOURCES))
x15_OBJECTS := $(call xbuild_replace_source_suffix,o,$(x15_SOURCES))
+x15_LDS_D := $(call xbuild_gen_linker_script_depfile,$(x15_LDS_S))
x15_LDS := $(basename $(x15_LDS_S))
XBUILD_LDFLAGS += -Xlinker -T $(x15_LDS)
@@ -300,7 +308,7 @@ x15_DEPS := $(x15_LDS) .x15.sorted_init_ops
# rules file doesn't exist, the main source file is enough to trigger a
# rebuild. Afterwards, the dependency rules file is included here and the
# rules provide correct incremental compilation.
--include $(x15_OBJDEPS)
+-include $(x15_OBJDEPS) $(x15_LDS_D)
%.o: %.c include/generated/autoconf.h
$(xbuild_compile)
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index 6d42496..5ed0502 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -21,6 +21,7 @@
#include <assert.h>
#include <stdalign.h>
#include <stddef.h>
+#include <stdint.h>
#include <string.h>
#include <kern/cpumap.h>
@@ -39,7 +40,6 @@
#include <machine/biosmem.h>
#include <machine/boot.h>
#include <machine/cpu.h>
-#include <machine/lapic.h>
#include <machine/page.h>
#include <machine/pmap.h>
#include <machine/tcb.h>
diff --git a/kern/console.c b/kern/console.c
index 0b5c4f8..0ed54b5 100644
--- a/kern/console.c
+++ b/kern/console.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include <string.h>
#include <kern/arg.h>
diff --git a/kern/init.c b/kern/init.c
index 6bd4838..da106ac 100644
--- a/kern/init.c
+++ b/kern/init.c
@@ -26,6 +26,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
#include <kern/error.h>
diff --git a/kern/printf.c b/kern/printf.c
index 68cf4ba..29267a6 100644
--- a/kern/printf.c
+++ b/kern/printf.c
@@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <stdio.h>
+
#include <kern/console.h>
#include <kern/fmt.h>
#include <kern/init.h>
diff --git a/kern/sref.c b/kern/sref.c
index 7775a5c..051fe4c 100644
--- a/kern/sref.c
+++ b/kern/sref.c
@@ -44,6 +44,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include <kern/condition.h>
#include <kern/cpumap.h>
diff --git a/kern/work.c b/kern/work.c
index a841d38..c1bdede 100644
--- a/kern/work.c
+++ b/kern/work.c
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stdalign.h>
#include <stddef.h>
+#include <stdio.h>
#include <kern/bitmap.h>
#include <kern/error.h>
diff --git a/vm/vm_page.c b/vm/vm_page.c
index 7f419b9..a384466 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -34,6 +34,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
#include <kern/init.h>
@@ -42,6 +43,7 @@
#include <kern/macros.h>
#include <kern/mutex.h>
#include <kern/panic.h>
+#include <kern/printf.h>
#include <kern/shell.h>
#include <kern/thread.h>
#include <machine/boot.h>