Revise makefile structure.
[pintos-anon] / src / Make.config
1 # -*- makefile -*-
2
3 SHELL = /bin/sh
4
5 # Binary utilities.
6 # If the host appears to be x86, use the normal tools.
7 # Otherwise assume cross-tools are installed as i386-elf-*.
8 X86 = i.86\|pentium.*\|[pk][56]\|nexgen\|viac3\|6x86\|athlon.*
9 ifneq (0, $(shell expr `uname -m` : '$(X86)'))
10 CC = gcc
11 LD = ld
12 OBJCOPY = objcopy
13 else
14 CC = i386-elf-gcc
15 LD = i386-elf-ld
16 OBJCOPY = i386-elf-objcopy
17 endif
18
19 # Other utilities.
20 DD = dd
21 RM = rm
22 CAT = cat
23
24 # Compiler and assembler invocation.
25 WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes
26 CFLAGS = -g -O3 -MMD -msoft-float 
27 ASFLAGS = -Wa,--gstabs -MMD
28
29 %.o: %.c
30         $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES)
31
32 %.o: %.S
33         $(CC) -c $< -o $@ $(ASFLAGS) $(CPPFLAGS) $(DEFINES)