aboutsummaryrefslogtreecommitdiff
path: root/drivers/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/makefile')
-rw-r--r--drivers/makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/makefile b/drivers/makefile
index 0d9071a..ad255c4 100644
--- a/drivers/makefile
+++ b/drivers/makefile
@@ -1,2 +1,20 @@
CXX_OBJ += drivers/cga.o \
drivers/serial.o
+
+HWH := drivers/hardware.h
+autogen := $(autogen) $(HWH)
+
+$(HWH): .config
+ @echo " GEN $@"
+ @echo \/\* autogenerated hardware description \*\/ > $(HWH)
+ @echo \#pragma once >> $(HWH)
+ifdef CONFIG_video0_enable
+ @echo \#define HAS_VIDEO0 >> $(HWH)
+ @echo $(CONFIG_VIDEO0_CLASS) video0\; >> $(HWH)
+ @echo constexpr bool video0_console = true\; >> $(HWH)
+endif
+ifdef CONFIG_serial0_enable
+ @echo \#define HAS_SERIAL0 >> $(HWH)
+ @echo $(CONFIG_SERIAL0_CLASS) serial0\; >> $(HWH)
+ @echo constexpr bool serial0_console = true\; >> $(HWH)
+endif