-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 746 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 746 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
CC=gcc
CFLAGS=-g -O0
SUPPRESS_WARN=-w
MES=mod-elf-symbol
SDIR=src
SYMBOL=foo
_OBJS = mod-elf-symbol.o util.o
OBJS = $(patsubst %,$(SDIR)/%,$(_OBJS))
$(SDIR)/%.o: $(SDIR)/%.c
$(CC) $(CFLAGS) $(SUPPRESS_WARN) -c $< -o $@
default: $(OBJS)
${CC} $(CFLAGS) -c main.c
${CC} ${SDIR}/*.o -o ${MES}
readelf: main.o
readelf -s main.o | grep ${SYMBOL}
run_append: default readelf
./${MES} -o main.o -s ${SYMBOL} --singlestr=bar
readelf -s main.o | grep ${SYMBOL}
run_replace: default readelf
./${MES} -o main.o -c ${SYMBOL} --completestr=bar
readelf -s main.o | grep bar
run_number: default readelf
./${MES} -o main.o -k ${SYMBOL} --keepnumstr=__
readelf -s main.o | grep ${SYMBOL}
.PHONY: clean
clean:
rm -rf *.o ./src/*.o $(MES) a.out