-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (25 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
37 lines (25 loc) · 1.01 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
CFLAGS = -g -std=gnu99 -fno-stack-protector
CC = gcc
default: all
check: clean libckpt hello run_hello restart run_restart
run_hello:
(sleep 3 && kill -12 `pgrep -n hello` && sleep 2 && pkill -9 -n hello) &
./hello; true
run_restart:
(sleep 3 && pkill -9 -n myrestart) &
./myrestart myckpt; true
all: clean libckpt2 libckpt3 hello restart
libckpt:
$(CC) $(CFLAGS) -c -o ckpt.o ckpt.c && ar rcs libckpt.a ckpt.o
libckpt2:
$(CC) $(CFLAGS) -I/usr/local/include/ -Wall -c -o ckpt.o ckpt.c && ar rcs libckpt.a ckpt.o
libckpt3:
$(CC) $(CFLAGS) -I/usr/local/include/ -Wall -c -o ckpt_restart.o ckpt_restart.c && ar rcs libckpt3.a ckpt_restart.o
hello:
$(CC) $(CFLAGS) -L`pwd` -lckpt -lgit2 -lcurl -ljansson -Wl,-u,myconstructor hello.c -o hello
restart:
$(CC) $(CFLAGS) -static -Wl,-Ttext-segment=5000000 -Wl,-Tdata=5100000 -Wl,-Tbss=5200000 myrestart.c -o myrestart -L`pwd` -lckpt3
clean:
rm -rf hello myrestart libckpt.a *.o myckpt
dist:
dir=`basename $$PWD`; cd ..; tar cvf $$dir.tar ./$$dir; gzip $$dir.tar