aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Makefile b/src/Makefile
index 7c2ee5f..1c2b408 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,25 +1,25 @@
EXEC := boucane
-CC := gcc -c -fno-pie -fno-builtin -fno-stack-protector -I ./
+CC := g++ -nostdlib -nostdinc -no-pie -fno-builtin -fno-stack-protector -I ./ -I include
LD_SCRIPT := linker.ld
# Note that BOOT_OBJ do not match boot.S
# Indeed boot.o generated by boot.S should appear
# first in the kernel binary (thus it must be linked first, cf the $(EXEC) rule)
-BOOT_OBJ := $(addsuffix .o,$(basename $(shell find ./boot -name "*.[c|S]" ! -name "boot.S")))
-DRIVERS_OBJ := $(addsuffix .o,$(basename $(shell find ./drivers -name "*.[c|S]")))
-LIBC_OBJ := $(addsuffix .o,$(basename $(shell find ./libc -name "*.[c|S]")))
+BOOT_OBJ := $(addsuffix .cc,$(basename $(shell find ./boot -name '*.cc' -name '*.S' ! -name "boot.S")))
+DRIVERS_OBJ := $(addsuffix .o,$(basename $(shell find ./drivers -name '*.cc' -o -name '*.S')))
+LIBS_OBJ := $(addsuffix .cc,$(basename $(shell find ./libs -name '*.cc' -o -name '*.S')))
all: $(EXEC)
-$(EXEC): boot/boot.o $(BOOT_OBJ) $(DRIVERS_OBJ) $(LIBC_OBJ) boucane.o
- ld -n -T $(LD_SCRIPT) -nostdlib -o $@ $^
+$(EXEC): boot/boot.o $(BOOT_OBJ) $(DRIVERS_OBJ) $(LIBS_OBJ) boucane.o
+ $(CC) -n -T $(LD_SCRIPT) -nostdlib -o $@ $^
%.o: %.S
as -o $@ $^
-%.o: %.c
- $(CC) -o $@ $<
-
+%.o: %.cc
+ $(CC) -c -o $@ $^
+
clean:
rm -f $(EXEC)
find ./ -name "*.o" -delete