Skip to content

Commit

Permalink
build: do not depend on nasm anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Jan 30, 2024
1 parent 0341a67 commit 6923567
Show file tree
Hide file tree
Showing 14 changed files with 327 additions and 329 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ $(kernel): $(linker_ld) $(libk_asm_objects) $(libk_c_objects) $(libk_extra_objec
$(libk_asm_objects): $(libk_objs_dir)/%.o: %.asm
$(progress) "CC" $<
$(MKDIR) -p $(dir $@)
$(ASM) $(KERNEL_ASM_FLAGS) $< -o $@
$(CC) $(KERNEL_ASM_FLAGS) $< -o $@

$(libk_c_objects): $(libk_objs_dir)/%.o: %.c
$(progress) "CC" $<
Expand All @@ -321,7 +321,7 @@ $(libc_c_objects): $(lib_objs_dir)/%.o: %.c
$(libc_asm_objects): $(lib_objs_dir)/%.o: %.asm
$(progress) "CC" $<
$(MKDIR) -p $(dir $@)
$(ASM) $(LIBC_ASM_FLAGS) $< -o $@
$(CC) $(LIBC_ASM_FLAGS) $< -o $@

$(libc): $(libc_asm_objects) $(libc_c_objects) | $(dist_dir)
$(progress) "AR" $@
Expand Down Expand Up @@ -409,7 +409,6 @@ fmt: ## automatically format the code with clang-format

version: ## print tool versions
$(CC) --version
$(ASM) --version
$(LD) --version
$(AR) --version
$(QEMU) --version
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ The following dependencies are required to build this project:
If you want to work on the `x86_64` architecture, you'll need the following
extra dependencies:

- `nasm`
- `grub-mkrescue`
- `xorriso`

Expand Down Expand Up @@ -134,7 +133,7 @@ depending on the architecture and board configured.
Install [Homebrew](https://brew.sh/), then run the following commands:

```
$ brew install nasm xorriso qemu llvm u-boot-tools
$ brew install xorriso qemu llvm u-boot-tools
```

#### Linux
Expand Down
1 change: 0 additions & 1 deletion src/kernel/arch/aarch32/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ log_file = $(log_dir)/$(ARCH)-$(BOARD)-$(BUILD_MODE).log

QEMU = qemu-system-arm
ARM_GCC = arm-none-eabi-gcc
ASM = $(CC)

###############################################################################
# Options for the different tools
Expand Down
1 change: 0 additions & 1 deletion src/kernel/arch/aarch64/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ log_file = $(log_dir)/$(ARCH)-$(BOARD)-$(BUILD_MODE).log
###############################################################################

QEMU = qemu-system-aarch64
ASM = $(CC)

###############################################################################
# Options for the different tools
Expand Down
10 changes: 5 additions & 5 deletions src/kernel/arch/x86_64/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ vbe_bpp = 32
# Tools
###############################################################################

ASM = nasm
QEMU = qemu-system-x86_64

###############################################################################
Expand Down Expand Up @@ -60,14 +59,15 @@ libk_extra_objects += $(kernel_console_font)
# Flags
###############################################################################

LD_TARGET = elf_x86_64
LIBC_ASM_FLAGS += -f elf64
LIBC_CFLAGS += --target=x86_64 -fstack-protector-strong
X86_64_CFLAGS += --target=x86_64
LIBC_ASM_FLAGS += -c $(X86_64_CFLAGS)
LIBC_CFLAGS += $(X86_64_CFLAGS) -fstack-protector-strong
LIBC_CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-avx -mno-avx2
KERNEL_ASM_FLAGS += -f elf64
KERNEL_ASM_FLAGS += -c $(X86_64_CFLAGS)
KERNEL_ASM_FLAGS += -dVBE_WIDTH=$(vbe_width) -dVBE_HEIGHT=$(vbe_height) -dVBE_BPP=$(vbe_bpp)
KERNEL_CFLAGS += -mno-red-zone
KERNEL_INCLUDES += -I$(external_dir)/scalable-font2/
LD_TARGET = elf_x86_64

###############################################################################
# Arch-specific targets
Expand Down
Loading

0 comments on commit 6923567

Please sign in to comment.