CC = gcc
+LD = ld
+UNAME := $(shell uname -s)
+ifeq ($(UNAME), Darwin)
+ CC = i686-elf-gcc
+ LD = i686-elf-ld
+endif
CFLAGS = -g -c -fno-builtin -m32
SYSTEMMAP = System.map
KERNELBIN = KERNEL.BIN
OBJS := $(patsubst %,%.o,$(SOURCE_FILES))
${KERNELBIN}: ${OBJS}
- ld -m elf_i386 -M -T$(LINKSCRIPT) $(OBJS) -o $@ > $(SYSTEMMAP)
+ ${LD} -m elf_i386 -M -T$(LINKSCRIPT) $(OBJS) -o $@ > $(SYSTEMMAP)
rm kernel/setup.c.o
%.S.o: %.S ${HEADER_FILES}