-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (25 loc) · 772 Bytes
/
Makefile
File metadata and controls
29 lines (25 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# Makefile for Menu Program
#
CC_PTHREAD_FLAGS = -lpthread
CC_FLAGS = -c
CC_OUTPUT_FLAGS = -o
CC = gcc
RM = rm
RM_FLAGS = -f
TARGET = test
OBJS = linktable.o menu.o test.o
all: $(OBJS)
$(CC) $(CC_OUTPUT_FLAGS) $(TARGET) $(OBJS)
rootfs:
gcc -o init linktable.c menu.c test.c -m32 -static -lpthread
gcc -o hello hello.c -m32 -static
find init hello | cpio -o -Hnewc |gzip -9 > ../rootfs.img
qemu: rootfs
qemu -kernel ../linux-3.18.6/arch/x86/boot/bzImage -initrd ../rootfs.img
qemu-gdb: rootfs
qemu -kernel ../linux-3.18.6/arch/x86/boot/bzImage -initrd ../rootfs.img -s -S
.c.o:
$(CC) $(CC_FLAGS) $<
clean:
$(RM) $(RM_FLAGS) $(OBJS) $(TARGET) *.bak