Permalink
Browse files

updated makefiles

  • Loading branch information...
1 parent 47df39c commit 4586ab2da9563f83ce835cac4a076b0cc5141c06 @jezze committed Jan 7, 2012
Showing with 26 additions and 39 deletions.
  1. +2 −2 Makefile
  2. +3 −7 kernel/Makefile
  3. +2 −2 kernel/arch/arm/Makefile
  4. +2 −1 kernel/arch/x86/Makefile
  5. +4 −12 lib/Makefile
  6. +2 −2 lib/arch/arm/Makefile
  7. +1 −4 lib/arch/x86/Makefile
  8. +3 −9 modules/Makefile
  9. +7 −0 rules.mk
View
@@ -1,5 +1,5 @@
-ARCH=x86
-TARGET=i586-pc-fudge
+include rules.mk
+
DIR_IMAGE=build/root
DIR_SOURCE_KERNEL=kernel
DIR_SOURCE_LIB=lib
View
@@ -1,13 +1,9 @@
-all-arm: ARCH=arm
-all-arm: GCC=arm-none-eabi-gcc
+include ../rules.mk
+
all-arm: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs
-all-arm: LD=arm-none-eabi-ld
all-arm: LDFLAGS=-T${DIR_SOURCE_ARCH}/linker.ld -L/usr/lib/gcc/arm-none-eabi/4.6.1/ -lgcc
-all-x86: ARCH=x86
-all-x86: GCC=gcc
all-x86: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs -m32
-all-x86: LD=ld
-all-x86: LDFLAGS=-T${DIR_SOURCE_ARCH}/linker.ld -melf_i386
+all-x86: LDFLAGS=-T${DIR_SOURCE_ARCH}/linker.ld
DIR_SOURCE_ARCH=arch/${ARCH}
DIR_SOURCE_LIB=../lib
View
@@ -1,6 +1,6 @@
-ASM=arm-none-eabi-as
+include ../../../rules.mk
+
ASMFLAGS=-c -mfpu=softfpa
-GCC=arm-none-eabi-gcc
GCCFLAGS=-c -O2 -I../../../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs
.PHONY: all clean arch
View
@@ -1,6 +1,7 @@
+include ../../../rules.mk
+
ASM=nasm
ASMFLAGS=-f elf
-GCC=gcc
GCCFLAGS=-c -O2 -I../../../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs -m32
.PHONY: all clean arch
View
@@ -1,14 +1,6 @@
-all-arm: ARCH=arm
-all-arm: GCC=arm-none-eabi-gcc
-all-arm: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -nostdlib -nostartfiles -ffreestanding -std=gnu99
-all-x86: ARCH=x86
-all-x86: GCC=gcc
-all-x86: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs -m32
+include ../rules.mk
-AR=ar
-ARFLAGS=rvs
-
-DIR_SOURCE_ARCH=arch/${ARCH}
+GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs
.PHONY: all clean lib
@@ -17,11 +9,11 @@ all-arm: lib
all-x86: lib
lib:
- @make -C ${DIR_SOURCE_ARCH}/
+ @make -C arch/${ARCH}/
@${GCC} ${GCCFLAGS} file.c -o file.o
@${GCC} ${GCCFLAGS} memory.c -o memory.o
@${GCC} ${GCCFLAGS} string.c -o string.o
- @${AR} ${ARFLAGS} libfudge.a ${DIR_SOURCE_ARCH}/crt0.o ${DIR_SOURCE_ARCH}/call.o file.o memory.o string.o
+ @${AR} ${ARFLAGS} libfudge.a arch/${ARCH}/crt0.o arch/${ARCH}/call.o file.o memory.o string.o
clean:
@make -C arch/arm/ clean
View
@@ -1,6 +1,6 @@
-ASM=arm-none-eabi-as
+include ../../../rules.mk
+
ASMFLAGS=-c -mfpu=softfpa
-GCC=arm-none-eabi-gcc
GCCFLAGS=-c -O2 -I../../../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs
.PHONY: all clean arch
View
@@ -1,7 +1,4 @@
-ASM=as
-ASMFLAGS=-c
-GCC=gcc
-GCCFLAGS=-c -O2 -I../../../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs -m32
+include ../../../rules.mk
.PHONY: all clean arch
View
@@ -1,15 +1,9 @@
-all-arm: ARCH=arm
-all-arm: GCC=arm-none-eabi-gcc
+include ../rules.mk
+
all-arm: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs
-all-arm: LD=arm-none-eabi-ld
all-arm: LDFLAGS=-r ../lib/memory.o ../lib/string.o -L/usr/lib/gcc/arm-none-eabi/4.6.1/ -lgcc
-all-x86: ARCH=x86
-all-x86: ASM=nasm
-all-x86: ASMFLAGS=-f elf
-all-x86: GCC=gcc
all-x86: GCCFLAGS=-c -O2 -I../include -Wall -Wextra -ffreestanding -nostdlib -nostartfiles -nodefaultlibs -m32
-all-x86: LD=ld
-all-x86: LDFLAGS=-r ../lib/memory.o ../lib/string.o -melf_i386
+all-x86: LDFLAGS=-r ../lib/memory.o ../lib/string.o
.PHONY: all clean modules
View
@@ -0,0 +1,7 @@
+ARCH=x86
+TARGET=i586-pc-fudge
+GCC=${TARGET}-gcc
+ASM=${TARGET}-as
+LD=${TARGET}-ld
+AR=ar
+ARFLAGS=rvs

0 comments on commit 4586ab2

Please sign in to comment.