summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap/stage1/Makefile13
-rw-r--r--bootstrap/stage1/arch/x86_64/make.conf4
-rw-r--r--bootstrap/stage1/firmware/efi/make.conf11
3 files changed, 13 insertions, 15 deletions
diff --git a/bootstrap/stage1/Makefile b/bootstrap/stage1/Makefile
index 7c3bf81..b80a16b 100644
--- a/bootstrap/stage1/Makefile
+++ b/bootstrap/stage1/Makefile
@@ -17,7 +17,12 @@
include $(ROOTDIR)/common.mk
-INCLUDE+=-I$(ARCHDIR)/include -Iinclude -I$(ROOTDIR)kernel/include -I$(ROOTDIR)kernel/arch/$(ARCH)/include
+ifeq ($(BS_DEBUG),YES)
+ AFLAGS+=-g
+ CFLAGS+=-g
+endif
+
+INCLUDE+=-I$(ARCHDIR)/include -Iinclude
CFLAGS+=-ffreestanding -fno-stack-protector $(BS_OPLVL)
BINARY=bootstrap-stage1
@@ -28,9 +33,6 @@ include $(FIRMWARE_DIR)/make.conf
COMMON_DIR=firmware/common
COMMON_OBJS=$(COMMON_DIR)/bprintf.o \
- $(COMMON_DIR)/elf_load.o \
- $(COMMON_DIR)/exception.o \
- $(COMMON_DIR)/rescue.o \
$(COMMON_DIR)/string.o \
OBJS=$(ARCH_OBJS) \
@@ -49,9 +51,10 @@ $(BINARY): $(OBJS)
@echo [CC] $@
%.o: %.s
+ @$(info $(AFLAGS))
@$(CC) -c $< -o $@ $(AFLAGS) $(INCLUDE)
clean:
- $(RM) $(BINARY) $(OBJS) $(OBJS:.o=.d)
+ $(RM) $(BINARY) $(OBJS) $(OBJS:.o=.d) $(OBJS:.o=.dwo) $(BINARY:=.dwp)
-include $(OBJS:.o=.d)
diff --git a/bootstrap/stage1/arch/x86_64/make.conf b/bootstrap/stage1/arch/x86_64/make.conf
index ec364c7..7c84b5c 100644
--- a/bootstrap/stage1/arch/x86_64/make.conf
+++ b/bootstrap/stage1/arch/x86_64/make.conf
@@ -15,13 +15,9 @@
# You should have received a copy of the GNU General Public License along with
# BoxOS; if not, see <https://www.gnu.org/licenses/>.
-INCLUDE+=-I$(ARCHDIR)/include
AFLAGS+=-target $(ARCH)-pc-win32-coff
CFLAGS+=-mno-red-zone -mno-mmx -mno-sse -mno-sse2 -target $(ARCH)-pc-win32-coff
LDFLAGS+=-entry:_start
ARCH_OBJS=$(ARCHDIR)/asm/entry.o \
$(ARCHDIR)/asm/__chkstk.o \
- $(ARCHDIR)/asm/paging.o \
- $(ARCHDIR)/paging.o \
- $(ARCHDIR)/serial.o \
diff --git a/bootstrap/stage1/firmware/efi/make.conf b/bootstrap/stage1/firmware/efi/make.conf
index 3b1615e..cee6fcd 100644
--- a/bootstrap/stage1/firmware/efi/make.conf
+++ b/bootstrap/stage1/firmware/efi/make.conf
@@ -1,14 +1,13 @@
LD:=lld-link
-ifeq (BS_DEBUG,YES)
- AFLAGS+=-gcodeview
- CFLAGS+=-gcodeview
+ifeq ($(BS_DEBUG),YES)
+ AFLAGS+=-gcodeview -gsplit-dwarf -gdwarf-4
+ CFLAGS+=-gcodeview -gsplit-dwarf -gdwarf-4
endif
CFLAGS+=-fshort-wchar
LDFLAGS+=-subsystem:efi_application -out:$(BINARY)
-FIRMWARE_OBJS=$(FIRMWARE_DIR)/efi.o \
- $(FIRMWARE_DIR)/bs_alloc.o \
+FIRMWARE_OBJS=$(FIRMWARE_DIR)/alloc.o \
+ $(FIRMWARE_DIR)/efi.o \
$(FIRMWARE_DIR)/tty.o \
- $(FIRMWARE_DIR)/util.o \