diff options
| author | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
| commit | 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch) | |
| tree | 868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /Make.config | |
| parent | eae0bd57f0a26314a94785061888d193d186944a (diff) | |
| download | progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2 progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip | |
reorganize file structure to match the upstream requirements
Diffstat (limited to 'Make.config')
| -rw-r--r-- | Make.config | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Make.config b/Make.config new file mode 100644 index 0000000..f00e8fc --- /dev/null +++ b/Make.config | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | # -*- makefile -*- | ||
| 2 | |||
| 3 | SHELL = /bin/sh | ||
| 4 | |||
| 5 | VPATH = $(SRCDIR) | ||
| 6 | |||
| 7 | # Binary utilities. | ||
| 8 | # If the host appears to be x86, use the normal tools. | ||
| 9 | # If it's x86-64, use the compiler and linker in 32-bit mode. | ||
| 10 | # Otherwise assume cross-tools are installed as i386-elf-*. | ||
| 11 | X86 = i.86\|pentium.*\|[pk][56]\|nexgen\|viac3\|6x86\|athlon.*\|i86pc | ||
| 12 | X86_64 = x86_64 | ||
| 13 | ifneq (0, $(shell expr `uname -m` : '$(X86)')) | ||
| 14 | CC = gcc | ||
| 15 | LD = ld | ||
| 16 | OBJCOPY = objcopy | ||
| 17 | else | ||
| 18 | ifneq (0, $(shell expr `uname -m` : '$(X86_64)')) | ||
| 19 | CC = gcc -m32 | ||
| 20 | LD = ld -melf_i386 | ||
| 21 | OBJCOPY = objcopy | ||
| 22 | else | ||
| 23 | CC = i386-elf-gcc | ||
| 24 | LD = i386-elf-ld | ||
| 25 | OBJCOPY = i386-elf-objcopy | ||
| 26 | endif | ||
| 27 | endif | ||
| 28 | |||
| 29 | ifeq ($(strip $(shell command -v $(CC) 2> /dev/null)),) | ||
| 30 | $(warning *** Compiler ($(CC)) not found. Did you set $$PATH properly? Please refer to the Getting Started section in the documentation for details. ***) | ||
| 31 | endif | ||
| 32 | |||
| 33 | # Compiler and assembler invocation. | ||
| 34 | DEFINES = | ||
| 35 | WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers | ||
| 36 | CFLAGS = -g -msoft-float -O | ||
| 37 | CPPFLAGS = -nostdinc -I$(SRCDIR) -I$(SRCDIR)/lib | ||
| 38 | ASFLAGS = -Wa,--gstabs | ||
| 39 | LDFLAGS = | ||
| 40 | DEPS = -MMD -MF $(@:.o=.d) | ||
| 41 | |||
| 42 | # Turn off -fstack-protector, which we don't support. | ||
| 43 | CFLAGS += -fno-stack-protector | ||
| 44 | |||
| 45 | # Turn off --build-id in the linker, which confuses the Pintos loader. | ||
| 46 | LDFLAGS += -Wl,--build-id=none | ||
| 47 | |||
| 48 | %.o: %.c | ||
| 49 | $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES) $(DEPS) | ||
| 50 | |||
| 51 | %.o: %.S | ||
| 52 | $(CC) -c $< -o $@ $(ASFLAGS) $(CPPFLAGS) $(DEFINES) $(DEPS) | ||
