-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (51 loc) · 1.51 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
72
73
74
##
## EPITECH PROJECT, 2018
## Project nm
## File description:
## Build nm binary.
##
COMMUN_DIR = commun
COMMUN_SRC = $(COMMUN_DIR)/elf/elf32.c \
$(COMMUN_DIR)/elf/elf64.c \
$(COMMUN_DIR)/elf/commun.c \
$(COMMUN_DIR)/errors/throw.c \
$(COMMUN_DIR)/file/utils.c \
$(COMMUN_DIR)/my_malloc.c \
$(COMMUN_DIR)/archive/ar.c
OBJDUMP_DIR = objdump
OBJDUMP_SRC := $(OBJDUMP_DIR)/source/main.c \
$(OBJDUMP_DIR)/source/objdump.c \
$(OBJDUMP_DIR)/source/print_section.c \
$(OBJDUMP_DIR)/source/flag_objdump.c \
OBJDUMP_SRC += $(COMMUN_SRC)
OBJDUMP_OBJ = $(OBJDUMP_SRC:.c=.o)
NM_DIR = nm
NM_SRC := $(NM_DIR)/source/main.c \
$(NM_DIR)/source/nm.c \
$(NM_DIR)/source/compare.c \
$(NM_DIR)/source/decode_symbol_one.c \
$(NM_DIR)/source/decode_symbol_two.c \
$(NM_DIR)/source/errors.c \
$(NM_DIR)/source/get_symbol.c \
NM_SRC += $(COMMUN_SRC)
NM_OBJ = $(NM_SRC:.c=.o)
CFLAGS = -Werror -Wextra -W -Wall -Wparentheses -Wpointer-sign -Wuninitialized -Wunused-but-set-variable -lm -I ./include -g
NM = my_nm
OBJDUMP = my_objdump
NM_RULE = nm
OBJDUMP_RULE = objdump
CC = gcc
all: $(NM_RULE) $(OBJDUMP_RULE)
$(NM_RULE): $(NM_OBJ)
$(CC) -o $(NM) $(NM_OBJ) $(CFLAGS)
$(OBJDUMP_RULE): $(OBJDUMP_OBJ)
$(CC) -o $(OBJDUMP) $(OBJDUMP_OBJ) $(CFLAGS)
clean:
rm -f $(OBJDUMP_OBJ)
rm -f $(NM_OBJ)
fclean: clean
rm -f $(NM)
rm -f $(OBJDUMP)
docker:
docker run -it -v `pwd`:/home/epitest -w /home/epitest epitechcontent/epitest-docker /bin/bash
re: fclean all