comparison src/Makefile @ 41:087d7b61c86b

cbc cmake version
author kono
date Sat, 02 Mar 2019 19:01:03 +0900
parents 83c23a36980d
children
comparison
equal deleted inserted replaced
40:162d92edbb0a 41:087d7b61c86b
1 # specify path to QEMU, installed with MacPorts 1 # CMAKE generated file: DO NOT EDIT!
2 QEMU = qemu-system-arm 2 # Generated by "Unix Makefiles" Generator, CMake Version 3.13
3 3
4 include makefile.inc 4 # Default target executed when no arguments are given to make.
5 default_target: all
5 6
6 # link the libgcc.a for __aeabi_idiv. ARM has no native support for div 7 .PHONY : default_target
7 LIBS = $(LIBGCC)
8 8
9 OBJS = \ 9 # Allow only one "make -f Makefile2" at a time, but pass parallelism.
10 lib/string.o \ 10 .NOTPARALLEL:
11 \
12 arm.o\
13 asm.o\
14 bio.o\
15 buddy.o\
16 console.o\
17 exec.o\
18 file.o\
19 fs.o\
20 log.o\
21 main.o\
22 memide.o\
23 pipe.o\
24 proc.o\
25 spinlock.o\
26 start.o\
27 swtch.o\
28 syscall.o\
29 sysfile.o\
30 sysproc.o\
31 trap_asm.o\
32 trap.o\
33 vm.o \
34 \
35 device/picirq.o \
36 device/timer.o \
37 device/uart.o
38 11
39 KERN_OBJS = $(OBJS) entry.o
40 kernel.elf: $(addprefix build/,$(KERN_OBJS)) kernel.ld build/initcode build/fs.img
41 cp -f build/initcode initcode
42 cp -f build/fs.img fs.img
43 $(call LINK_BIN, kernel.ld, kernel.elf, \
44 $(addprefix build/,$(KERN_OBJS)), \
45 initcode fs.img)
46 $(OBJDUMP) -S kernel.elf > kernel.asm
47 $(OBJDUMP) -t kernel.elf | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernel.sym
48 rm -f initcode fs.img
49 12
50 qemu: kernel.elf 13 #=============================================================================
51 @clear 14 # Special targets provided by cmake.
52 @echo "Press Ctrl-A and then X to terminate QEMU session\n"
53 $(QEMU) -M versatilepb -m 128 -cpu arm1176 -nographic -kernel kernel.elf
54 15
55 INITCODE_OBJ = initcode.o 16 # Disable implicit rules so canonical targets will work.
56 $(addprefix build/,$(INITCODE_OBJ)): initcode.S 17 .SUFFIXES:
57 $(call build-directory)
58 $(call AS_WITH, -nostdinc -I.)
59 18
60 #initcode is linked into the kernel, it will be used to craft the first process
61 build/initcode: $(addprefix build/,$(INITCODE_OBJ))
62 $(call LINK_INIT, -N -e start -Ttext 0)
63 $(call OBJCOPY_INIT)
64 $(OBJDUMP) -S $< > initcode.asm
65 19
66 build/fs.img: 20 # Remove some rules from gmake that .SUFFIXES does not remove.
67 make -C tools 21 SUFFIXES =
68 make -C usr
69 22
70 clean: 23 .SUFFIXES: .hpux_make_needs_suffix_list
71 rm -rf build 24
72 rm -f *.o *.d *.asm *.sym vectors.S bootblock entryother \ 25
73 initcode initcode.out kernel xv6.img fs.img kernel.elf memfs 26 # Suppress display of executed commands.
74 make -C tools clean 27 $(VERBOSE).SILENT:
75 make -C usr clean 28
29
30 # A target that is always out of date.
31 cmake_force:
32
33 .PHONY : cmake_force
34
35 #=============================================================================
36 # Set environment variables for the build.
37
38 # The shell in which to execute make rules.
39 SHELL = /bin/sh
40
41 # The CMake executable.
42 CMAKE_COMMAND = /usr/local/Cellar/cmake/3.13.4/bin/cmake
43
44 # The command to remove a file.
45 RM = /usr/local/Cellar/cmake/3.13.4/bin/cmake -E remove -f
46
47 # Escaping for special characters.
48 EQUALS = =
49
50 # The top-level source directory on which CMake was run.
51 CMAKE_SOURCE_DIR = /Users/one/src/xv6-gears/src
52
53 # The top-level build directory on which CMake was run.
54 CMAKE_BINARY_DIR = /Users/one/src/xv6-gears/src
55
56 #=============================================================================
57 # Targets provided globally by CMake.
58
59 # Special rule for the target rebuild_cache
60 rebuild_cache:
61 @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
62 /usr/local/Cellar/cmake/3.13.4/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
63 .PHONY : rebuild_cache
64
65 # Special rule for the target rebuild_cache
66 rebuild_cache/fast: rebuild_cache
67
68 .PHONY : rebuild_cache/fast
69
70 # Special rule for the target edit_cache
71 edit_cache:
72 @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
73 /usr/local/Cellar/cmake/3.13.4/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
74 .PHONY : edit_cache
75
76 # Special rule for the target edit_cache
77 edit_cache/fast: edit_cache
78
79 .PHONY : edit_cache/fast
80
81 # The main all target
82 all: cmake_check_build_system
83 $(CMAKE_COMMAND) -E cmake_progress_start /Users/one/src/xv6-gears/src/CMakeFiles /Users/one/src/xv6-gears/src/CMakeFiles/progress.marks
84 $(MAKE) -f CMakeFiles/Makefile2 all
85 $(CMAKE_COMMAND) -E cmake_progress_start /Users/one/src/xv6-gears/src/CMakeFiles 0
86 .PHONY : all
87
88 # The main clean target
89 clean:
90 $(MAKE) -f CMakeFiles/Makefile2 clean
91 .PHONY : clean
92
93 # The main clean target
94 clean/fast: clean
95
96 .PHONY : clean/fast
97
98 # Prepare targets for installation.
99 preinstall: all
100 $(MAKE) -f CMakeFiles/Makefile2 preinstall
101 .PHONY : preinstall
102
103 # Prepare targets for installation.
104 preinstall/fast:
105 $(MAKE) -f CMakeFiles/Makefile2 preinstall
106 .PHONY : preinstall/fast
107
108 # clear depends
109 depend:
110 $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
111 .PHONY : depend
112
113 #=============================================================================
114 # Target rules for targets named kernel
115
116 # Build rule for target.
117 kernel: cmake_check_build_system
118 $(MAKE) -f CMakeFiles/Makefile2 kernel
119 .PHONY : kernel
120
121 # fast build rule for target.
122 kernel/fast:
123 $(MAKE) -f CMakeFiles/kernel.dir/build.make CMakeFiles/kernel.dir/build
124 .PHONY : kernel/fast
125
126 c/kernel-context.o: c/kernel-context.c.o
127
128 .PHONY : c/kernel-context.o
129
130 # target to build an object file
131 c/kernel-context.c.o:
132 $(MAKE) -f CMakeFiles/kernel.dir/build.make CMakeFiles/kernel.dir/c/kernel-context.c.o
133 .PHONY : c/kernel-context.c.o
134
135 c/kernel-context.i: c/kernel-context.c.i
136
137 .PHONY : c/kernel-context.i
138
139 # target to preprocess a source file
140 c/kernel-context.c.i:
141 $(MAKE) -f CMakeFiles/kernel.dir/build.make CMakeFiles/kernel.dir/c/kernel-context.c.i
142 .PHONY : c/kernel-context.c.i
143
144 c/kernel-context.s: c/kernel-context.c.s
145
146 .PHONY : c/kernel-context.s
147
148 # target to generate assembly for a file
149 c/kernel-context.c.s:
150 $(MAKE) -f CMakeFiles/kernel.dir/build.make CMakeFiles/kernel.dir/c/kernel-context.c.s
151 .PHONY : c/kernel-context.c.s
152
153 # Help Target
154 help:
155 @echo "The following are some of the valid targets for this Makefile:"
156 @echo "... all (the default if no target is provided)"
157 @echo "... clean"
158 @echo "... depend"
159 @echo "... rebuild_cache"
160 @echo "... edit_cache"
161 @echo "... kernel"
162 @echo "... c/kernel-context.o"
163 @echo "... c/kernel-context.i"
164 @echo "... c/kernel-context.s"
165 .PHONY : help
166
167
168
169 #=============================================================================
170 # Special targets to cleanup operation of make.
171
172 # Special rule to run CMake to check the build system integrity.
173 # No rule that depends on this can have commands that come from listfiles
174 # because they might be regenerated.
175 cmake_check_build_system:
176 $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
177 .PHONY : cmake_check_build_system
178