-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 1.02 KB
/
Makefile
File metadata and controls
49 lines (37 loc) · 1.02 KB
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
# Compiler and Compiler Flags
CC=gcc
CFLAGS=-Wall -g -Iinclude -Ilib
# Linker flags
LDFLAGS=-lreadline -lm
# The build target executable:
TARGET1=powerOn
TARGET2=minios
# FORK_PROGRAM=kernel/20192490/print_os_name
# Source, Object files
SRCS=kernel/kernel.c \
kernel/system.c \
kernel/mem_s/mem_allocate.c \
kernel/mem_s/dummy_memory_management.c \
kernel/program_handle/execute.c \
kernel/program_handle/terminate.c \
lib/print_util.c \
lib/structlib.c \
OBJS=$(SRCS:.c=.o)
#Include directory
INCLUDE_DIR=include
PROGRAM_SRCS=$(wildcard program/*.c)
PROGRAM_EXES=$(PROGRAM_SRCS:.c=)
all: $(TARGET1) $(TARGET2) $(PROGRAM_EXES)
$(TARGET1): boot/boot.o
$(CC) $(CFLAGS) -o $(TARGET1) boot/boot.o $(LDFLAGS)
$(TARGET2): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET2) $(OBJS) $(LDFLAGS)
# Compile program folder .c files to executables
program/%: program/%.c
$(CC) -Wall -Iinclude -Ilib -o $@ $<
# To obtain object files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean up:
clean:
rm -f $(OBJS) $(TARGET) $(PROGRAM_EXES)