-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
71 lines (58 loc) · 1.98 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# Sample Makefile for COMP 421 Yalnix kernel and user programs.
#
# The Yalnix kernel built will be named "yalnix". *ALL* kernel
# Makefiles for this lab must have a "yalnix" rule in them, and
# must produce a kernel executable named "yalnix" -- we will run
# your Makefile and will grade the resulting executable
# named "yalnix".
#
# Your project must be implemented using the C programming
# language (e.g., not in C++ or other languages).
#
#
# Define the list of everything to be made by this Makefile.
# The list should include "yalnix" (the name of your kernel),
# plus the list of user test programs you also want to be mae
# by this Makefile. For example, the definition below
# specifies to make Yalnix test user programs test1, test2,
# and test3. You should modify this list to the list of your
# own test programs.
#
# For each user test program, the Makefile will make the
# program out of a single correspondingly named sourc file.
# For example, the Makefile will make test1 out of test1.c,
# if you have a file named test1.c in this directory.
#
ALL = yalnix idle
#
# You must modify the KERNEL_OBJS and KERNEL_SRCS definitions
# below. KERNEL_OBJS should be a list of the .o files that
# make up your kernel, and KERNEL_SRCS should be a list of
# the corresponding source files that make up your kernel.
#
KERNEL_OBJS = yalnix.o
KERNEL_SRCS = yalnix.c
#
# You should not have to modify anything else in this Makefile
# below here. If you want to, however, you may modify things
# such as the definition of CFLAGS, for example.
#
PUBLIC_DIR = /clear/courses/comp421/pub
CPPFLAGS = -I$(PUBLIC_DIR)/include
CFLAGS = -g -Wall
LANG = gcc
%: %.o
$(LINK.o) -o $@ $^ $(LOADLIBES) $(LDLIBS)
LINK.o = $(PUBLIC_DIR)/bin/link-user-$(LANG) $(LDFLAGS) $(TARGET_ARCH)
%: %.c
%: %.cc
%: %.cpp
all: $(ALL)
yalnix: $(KERNEL_OBJS)
$(PUBLIC_DIR)/bin/link-kernel-$(LANG) -o yalnix $(KERNEL_OBJS)
clean:
rm -f $(KERNEL_OBJS) $(ALL)
depend:
$(CC) $(CPPFLAGS) -M $(KERNEL_SRCS) > .depend
#include .depend