-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 874 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 874 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
30
31
32
33
34
35
36
vpath %.c ./src
SRC_FILES := isos_inject.c arg_parser.c
INCLUDE_DIR := include/
CC = gcc
CFLAGS = -Wall -pedantic -Wextra -I$(INCLUDE_DIR) -g -O2
LIBS = -liberty -lz -lbfd
build_dependencies: $(SRC_FILES:%.c=%.dep)
@cat $^ > make.test
@rm $^
%.dep: %.c
@gcc -I$(INCLUDE_DIR) -MM -MF $@ $<
all: objdir copybin bin/isos_inject bin/code_to_inject_entry bin/code_to_inject_got
objdir:
@mkdir -p obj
copybin:
@cp date.backup bin/date
obj/%.o: src/%.c
$(CC) -c -o $@ $< $(CFLAGS)
bin/isos_inject: obj/isos_inject.o obj/arg_parser.o
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
bin/code_to_inject_entry: src/code_to_inject_entry.s
nasm -f bin src/code_to_inject_entry.s -o bin/code_to_inject_entry
bin/code_to_inject_got: src/code_to_inject_got.s
nasm -f bin src/code_to_inject_got.s -o bin/code_to_inject_got
clean:
rm -f obj/*.o bin/*