blob: 36f01dc647761d39c7b07c6ac2b3ba69d018e50d [file] [log] [blame]
Kevin Wolfd1f3a232013-06-27 13:50:05 +02001CC=gcc
2CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc -fno-builtin
3ASFLAGS=-m32
4
5LD=ld
6LDFLAGS=-melf_i386 -T link.ld
7LIBS=$(shell $(CC) $(CCFLAGS) -print-libgcc-file-name)
8
Kevin Wolfa9c837d2015-01-15 12:26:44 +01009all: mmap.elf modules.elf
Kevin Wolfd1f3a232013-06-27 13:50:05 +020010
11mmap.elf: start.o mmap.o libc.o
12 $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
13
Kevin Wolfa9c837d2015-01-15 12:26:44 +010014modules.elf: start.o modules.o libc.o
15 $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
16
Kevin Wolfd1f3a232013-06-27 13:50:05 +020017%.o: %.c
18 $(CC) $(CCFLAGS) -c -o $@ $^
19
20%.o: %.S
21 $(CC) $(ASFLAGS) -c -o $@ $^