rulimine/src/Makefile

42 lines
672 B
Makefile
Raw Normal View History

CC = ../toolchain/bin/i386-elf-gcc
CFLAGS = -Os -pipe -Wall -Wextra
INTERNAL_CFLAGS = \
-ffreestanding \
-masm=intel \
-fno-pic \
-mno-sse \
-mno-sse2 \
-mno-mmx \
-mno-80387 \
-ffreestanding \
-fno-stack-protector \
-I.
LDFLAGS = -O2
INTERNAL_LDFLAGS = \
-nostdlib \
-no-pie \
-lgcc \
-static-libgcc \
-Tlinker.ld
.PHONY: all clean
2020-04-14 07:36:43 +03:00
C_FILES := $(shell find ./ -type f -name '*.c' | sort)
OBJ := $(C_FILES:.c=.o)
all: qloader2.bin
qloader2.bin: $(OBJ)
2020-01-22 02:56:20 +03:00
$(CC) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o stage2.bin
cd bootsect && nasm bootsect.asm -fbin -o ../qloader2.bin
%.o: %.c
$(CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ)