-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
47 lines (37 loc) · 1.08 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
NAME=pxz
VERSION=4.999.9beta
CFLAGS?=-O2 -Wall -Wshadow -Wcast-align -Winline -Wextra -Wmissing-noreturn
CFLAGS+=-fopenmp -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LDFLAGS+=-llzma
SOURCES=$(NAME).c Makefile COPYING $(NAME).1
OBJECTS=
EXECUTE=./$(NAME) CONTENTS.cpio
BINDIR?=/usr/bin
MANDIR?=/usr/share/man
all: $(OBJECTS) $(NAME)
$(NAME): $(SOURCES) $(OBJECTS)
$(CC) -o $(NAME) $(CPPFLAGS) $(CFLAGS) $(NAME).c $(OBJECTS) $(LDFLAGS) -DPXZ_BUILD_DATE=\"`date +%Y%m%d`\" -DPXZ_VERSION=\"$(VERSION)\"
clean:
rm -f *.o $(NAME)
distclean: clean
rm -f *~
dist: $(NAME)
LANG=C
rm -rf $(NAME)-$(VERSION)
mkdir $(NAME)-$(VERSION)
cp $(SOURCES) $(NAME)-$(VERSION)
tar fcJ $(NAME)-$(VERSION).`date +%Y%m%d`git.tar.xz $(NAME)-$(VERSION)
rm -rf $(NAME)-$(VERSION)
install: $(NAME)
mkdir -p $(DESTDIR)$(BINDIR)
cp $(NAME) $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp $(NAME).1 $(DESTDIR)$(MANDIR)/man1
ddd: $(NAME)
ddd --args $(EXECUTE)
gdb: $(NAME)
gdb --args $(EXECUTE)
time: $(NAME)
time $(EXECUTE)
valgrind: $(NAME)
valgrind -v --tool=memcheck --leak-check=yes $(EXECUTE)