Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- KSRCS = $(shell find -name '*.cxx' -o -name '*.s')
- KOBJS = $(addsuffix .o,$(basename $(KSRCS)))
- KERN = kernel.elf
- CC = cc
- CCX = g++
- LD = ld
- KASFLAGS = -m64
- KCXXFLAGS = -std=c++11 -m64 -Os -W -Wall -Wextra -nostdlib -fno-exceptions -fno-rtti -fno-stack-protector
- KLDFLAGS = -z max-page-size=0x1000 -Tlinker.ld
- $(KERN): $(KOBJS)
- $(LD) $(KLDFLAGS) -o $@ $^
- %.o: %.cxx
- $(CCX) $(KCXXFLAGS) -c -o $@ $^
- %.o: %.c
- $(CC) $(KCCFLAGS) -c -o $@ $^
- %.o: %.s
- $(CC) $(KASFLAGS) -c -o $@ $^
- clean:
- rm -f $(KOBJS)
- distclean:
- rm -f $(KOBJS)
- rm -f $(KERN)
- .PHONY: clean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement