summaryrefslogtreecommitdiff
path: root/ioreplay/Makefile
blob: 67f44215dd1d20e773ede8d902d50e2b7fc85e9a (plain)
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
#DEBUG=-g3 -ggdb3 -pg
NAME=ioreplay
LIBS=-pthread
CFLAGS=-Wall -std=gnu99 -pedantic
STATIC=#-static
DESTDIR=/opt/ioreplay/bin
SRCS=$(wildcard src/*.c src/*/*.c)
HDRS=$(SRCS:.c=.h)
OBJS=$(SRCS:.c=.o)
all: compile
quick: clean ctags compile sudo_install
cshell: compile
	gdb -ex='break main; run' --args ./$(NAME)
test: compile
	gdb -ex=run --args ./$(NAME) -U
compile: $(OBJS)
	$(CC) $(STATIC) $(DEBUG) $(LIBS) $(OBJS) -o $(NAME)
%.o: %.c %.h
	$(CC) $(STATIC) $(DEBUG) $(LIBS) -c $(CFLAGS) $< -o $@
clean:
	rm -v ioreplay ./src/*.o ./src/*/*.o 2>/dev/null || exit 0
install:
	test ! -d $(DESTDIR) && mkdir -p $(DESTDIR) || exit 0
	cp -v $(NAME) $(DESTDIR)
	@echo "Don't forget to add $(DESTDIR) to your PATH as follows:"
	@echo "	export PATH=\$$PATH:$(DESTDIR)"
uninstall:
	test ! -z "$(DESTDIR)" && test -f $(DESTDIR)/$(NAME) && rm -v $(DESTDIR)/$(NAME) || exit 0
deinstall: uninstall
astyle:
	astyle -n --style=linux src/*.h src/*/*.h
	astyle -n --style=linux src/*.c src/*/*.c
todo:
	fgrep ../TODO ./src/*
ctags:
	ctags ./src/*.{h,c} ./src/*/*.{h,c}