Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ GRUB_CONFIG := $(ARCH_DIR)/build/grub.cfg

# sources
C_SOURCES := $(shell find $(SRC_DIR) -type f -name '*.c' ! -name '*.excluded.c')
CPP_SOURCES := $(shell find $(SRC_DIR) -type f -name '*.cpp' ! -name '*.excluded.cpp')
ASM_SOURCES := $(shell find $(SRC_DIR) -type f -name '*.asm')

# filtered sources
# assuming C++ is only in src/apps, so there is no need
# to exclude it based on architecture
C_SOURCES_FILTERED := \
$(filter-out $(SRC_DIR)/arch/%,$(C_SOURCES)) \
$(filter $(SRC_DIR)/arch/$(ARCH)/%,$(C_SOURCES))
Expand All @@ -47,11 +44,10 @@ ASM_SOURCES_FILTERED := \

# objects
C_OBJECTS := $(patsubst $(SRC_DIR)/%.c,$(BIN_DIR)/%.o,$(C_SOURCES_FILTERED))
CPP_OBJECTS := $(patsubst $(SRC_DIR)/%.cpp,$(BIN_DIR)/%.o,$(CPP_SOURCES))
ASM_OBJECTS := $(patsubst $(SRC_DIR)/%.asm,$(BIN_DIR)/%.o,$(ASM_SOURCES_FILTERED))

# all objects
OBJECTS := $(C_OBJECTS) $(CPP_OBJECTS) $(ASM_OBJECTS)
OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS)

# main target
all: build_kernel build_iso
Expand All @@ -61,13 +57,7 @@ all: build_kernel build_iso
$(BIN_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(dir $@)
@echo -e "\033[1;36m[*]\033[0m $< -> $@"
@gcc -g -Wall -Wextra -m$(ARCH_M) -ffreestanding -nostartfiles -Iinclude -nostdlib -fno-stack-protector -c $< -o $@

# build c++ sources
$(BIN_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(dir $@)
@echo -e "\033[1;36m[*]\033[0m $< -> $@"
@g++ -g -Wall -Wextra -m$(ARCH_M) -ffreestanding -fno-rtti -fno-threadsafe-statics -nostartfiles -Iinclude -nostdlib -fno-stack-protector -fno-exceptions -c $< -o $@
@gcc -g -Wall -Wextra -m$(ARCH_M) -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -ffreestanding -nostartfiles -Iinclude -nostdlib -fno-stack-protector -c $< -o $@

# build assembly sources
$(BIN_DIR)/%.o: $(SRC_DIR)/%.asm
Expand Down
4 changes: 4 additions & 0 deletions compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
-fno-stack-protector
-fno-exceptions
-fno-rtti
-mno-sse
-mno-sse2
-mno-sse3
-mno-mmx
1 change: 1 addition & 0 deletions include/apps/calc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
void calculator_main();
1 change: 0 additions & 1 deletion include/apps/calc.hpp

This file was deleted.

7 changes: 7 additions & 0 deletions include/apps/tinypad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include <screen.h>
#include <types.h>
#include <input.h>

int tinypad_main(uint8_t color, uint8_t barcolor);
19 changes: 0 additions & 19 deletions include/apps/tinypad.hpp

This file was deleted.

14 changes: 6 additions & 8 deletions src/apps/calc/calc.cpp → src/apps/calc/calc.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
extern "C" {
#include <input.h>
#include <msg.h>
#include <string.h>
#include <types.h>
#include <numbers.h>
}
#include <input.h>
#include <msg.h>
#include <string.h>
#include <types.h>
#include <numbers.h>

extern "C" void calculator_main() {
void calculator_main() {
int64_t left;
int64_t right;
char sign[2]; // leaving a space for a null-terminator
Expand Down
Loading
Loading