Kevin Wolf | d1f3a23 | 2013-06-27 13:50:05 +0200 | [diff] [blame] | 1 | CC=gcc |
| 2 | CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc -fno-builtin |
| 3 | ASFLAGS=-m32 |
| 4 | |
| 5 | LD=ld |
| 6 | LDFLAGS=-melf_i386 -T link.ld |
| 7 | LIBS=$(shell $(CC) $(CCFLAGS) -print-libgcc-file-name) |
| 8 | |
Kevin Wolf | a9c837d | 2015-01-15 12:26:44 +0100 | [diff] [blame] | 9 | all: mmap.elf modules.elf |
Kevin Wolf | d1f3a23 | 2013-06-27 13:50:05 +0200 | [diff] [blame] | 10 | |
| 11 | mmap.elf: start.o mmap.o libc.o |
| 12 | $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 13 | |
Kevin Wolf | a9c837d | 2015-01-15 12:26:44 +0100 | [diff] [blame] | 14 | modules.elf: start.o modules.o libc.o |
| 15 | $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 16 | |
Kevin Wolf | d1f3a23 | 2013-06-27 13:50:05 +0200 | [diff] [blame] | 17 | %.o: %.c |
| 18 | $(CC) $(CCFLAGS) -c -o $@ $^ |
| 19 | |
| 20 | %.o: %.S |
| 21 | $(CC) $(ASFLAGS) -c -o $@ $^ |