2013-06-27 15:50:05 +04:00
|
|
|
CC=gcc
|
|
|
|
CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc -fno-builtin
|
|
|
|
ASFLAGS=-m32
|
|
|
|
|
|
|
|
LD=ld
|
|
|
|
LDFLAGS=-melf_i386 -T link.ld
|
|
|
|
LIBS=$(shell $(CC) $(CCFLAGS) -print-libgcc-file-name)
|
|
|
|
|
2015-01-15 14:26:44 +03:00
|
|
|
all: mmap.elf modules.elf
|
2013-06-27 15:50:05 +04:00
|
|
|
|
|
|
|
mmap.elf: start.o mmap.o libc.o
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
|
2015-01-15 14:26:44 +03:00
|
|
|
modules.elf: start.o modules.o libc.o
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
|
|
|
|
2013-06-27 15:50:05 +04:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CCFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(CC) $(ASFLAGS) -c -o $@ $^
|