Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 64 lines (44 sloc) 0.972 kB
7640cab @temoto initial import
authored
1 # k411 Makefile
2 #
3
477348b @temoto one i386 arch (32bit); removed all about x86-64; better structure of …
authored
4 # General
5 # ^^^^^^^
7640cab @temoto initial import
authored
6
5aecf29 @temoto Makefile: use DEBUG=0 to disable debug information
authored
7 DEBUG := 1
ebf9d79 @temoto Lowest level code copied from Dux/metodo. See http://github.com/Rocke…
authored
8
9 CC := gcc
10 AS := nasm
11 LD := ld
12
5aecf29 @temoto Makefile: use DEBUG=0 to disable debug information
authored
13 CFLAGS := $(CFLAGS) -std=c99 -Wall -Wextra -Werror \
ebf9d79 @temoto Lowest level code copied from Dux/metodo. See http://github.com/Rocke…
authored
14 -ffreestanding -nostdlib -nostartfiles -nodefaultlibs \
15 -I$(shell pwd)/include
5aecf29 @temoto Makefile: use DEBUG=0 to disable debug information
authored
16
17 ifeq ("$(DEBUG)", "1")
823ad60 @temoto Makefile: define DEBUG in CFLAGS
authored
18 CFLAGS += -g -DDEBUG
5aecf29 @temoto Makefile: use DEBUG=0 to disable debug information
authored
19 ASFLAGS += -g
20 endif
21
ebf9d79 @temoto Lowest level code copied from Dux/metodo. See http://github.com/Rocke…
authored
22 MAKEFLAGS += --no-print-directory
c44453e @temoto moved all kernel code to kernel/ dir
authored
23
5aecf29 @temoto Makefile: use DEBUG=0 to disable debug information
authored
24
477348b @temoto one i386 arch (32bit); removed all about x86-64; better structure of …
authored
25 # Architecture
26 # ^^^^^^^^^^^^
27
28 ARCH := $(shell uname -m | sed -e s/i.86/i386/)
29 ifeq ($(ARCH),x86_64)
30 ARCH := i386
31 endif
32
33 ifeq ("$(ARCH)", "i386")
34 CFLAGS += -m32
ebf9d79 @temoto Lowest level code copied from Dux/metodo. See http://github.com/Rocke…
authored
35 ASFLAGS += -f elf32
477348b @temoto one i386 arch (32bit); removed all about x86-64; better structure of …
authored
36 LDFLAGS += -melf_i386
37 else
38 $(error Unsupported ARCH: $(ARCH))
39 endif
40
ebf9d79 @temoto Lowest level code copied from Dux/metodo. See http://github.com/Rocke…
authored
41 version := $(shell git rev-parse --short HEAD)
42
43 CFLAGS += -DARCH=$(ARCH) -DARCH_$(ARCH) \
44 -DK411_BUILD_STR="\"$(version) $(ARCH) debug\""
45
c44453e @temoto moved all kernel code to kernel/ dir
authored
46 export CC AS LD CFLAGS ASFLAGS LDFLAGS ARCH DEBUG
477348b @temoto one i386 arch (32bit); removed all about x86-64; better structure of …
authored
47
7640cab @temoto initial import
authored
48
c44453e @temoto moved all kernel code to kernel/ dir
authored
49 # Targets
50 # ^^^^^^^
7640cab @temoto initial import
authored
51
86abe87 @temoto Makefile: default target is 'kernel' now, not rebuilding each time
authored
52 .PHONY: clean kernel test
7640cab @temoto initial import
authored
53
86abe87 @temoto Makefile: default target is 'kernel' now, not rebuilding each time
authored
54 # default target
55 kernel:
c44453e @temoto moved all kernel code to kernel/ dir
authored
56 @$(MAKE) -C kernel ../kernel-$(ARCH).bin
7640cab @temoto initial import
authored
57
58 clean:
c44453e @temoto moved all kernel code to kernel/ dir
authored
59 @$(MAKE) -C kernel $@
7640cab @temoto initial import
authored
60
a1d88d0 @temoto Makefile: added test target stub
authored
61 test:
c44453e @temoto moved all kernel code to kernel/ dir
authored
62 @echo "No tests yet, sorry."
a1d88d0 @temoto Makefile: added test target stub
authored
63 @exit 1
Something went wrong with that request. Please try again.