-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 996 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (29 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Julios Makefile
# Configuration
VERSION := 1
CC := /usr/bin/gcc
CPLUSPLUSC := /usr/bin/g++
ASM := nasm
CFLAGS := -m32 -ffreestanding -Wall -Werror -nostdlib -nostartfiles -nodefaultlibs -I "$(CURDIR)" $(CFLAGS)
#CPLUSPLUSFLAGS := -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
CPLUSPLUSFLAGS := -m32 -Wall -nostartfiles -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I "$(CURDIR)" $(CPLUSPLUSFLAGS)
LDFLAGS := -melf_i386 -nostdlib $(LDFLAGS)
OBJFILES := startup.o kernel.o screen.o memory.o io.o interrupts.o keyboard.o multiboot.o gdt.o
OUTFILE := kernel
.PHONY: clean
# Rules
kernel: $(OBJFILES)
@echo "Assembling kernel image ... "
@ld $(LDFLAGS) -T ld.conf -o kernel $(OBJFILES)
%.o: %.asm Makefile
@echo "Compiling $<... "
@$(ASM) -f elf -o $@ $<;
%.o: %.c Makefile
@echo "Compiling $<... "
@$(CC) $(CFLAGS) -c $< -o $@;
%.o: %.cpp Makefile
@echo "Compiling $<... "
@$(CPLUSPLUSC) $(CPLUSPLUSFLAGS) -c $< -o $@;
all: kernel
clean:
@rm *.o kernel