-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile.in
59 lines (43 loc) · 1.57 KB
/
Makefile.in
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
CC ?= %CC%
CFLAGS += -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include %CFLAGS% $(RPM_OPT_FLAGS)
LDFLAGS += -L/usr/local/lib
LDLIBS += %LDLIBS% %PTHREAD%
BINARIES = ttyrec ttyplay ttytime
include config.mk
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),FreeBSD)
MANDIR ?= $(PREFIX)/man
else
MANDIR ?= $(PREFIX)/share/man
endif
.PHONY: all deb rpm clean distclean style dist install test
all: $(BINARIES)
deb:
dpkg-buildpackage -b -rfakeroot -us -uc
rpm: clean
o=$$PWD && t=$$(mktemp -d) && cd $$t && mkdir ovh-ttyrec && rsync -a --exclude=.git $$o/ ovh-ttyrec/ && zip -9r ~/rpmbuild/SOURCES/master.zip ovh-ttyrec
rpmbuild -bb ovh-ttyrec.spec
ls -lh ~/rpmbuild/RPMS/*/ovh-ttyrec*.rpm
ttyrec: ttyrec.o io.o compress.o %COMPRESS_ZSTD%
$(CC) $(CFLAGS) -o $@ ttyrec.o io.o compress.o %COMPRESS_ZSTD% $(LDFLAGS) $(LDLIBS)
ttyplay: ttyplay.o io.o compress.o %COMPRESS_ZSTD%
$(CC) $(CFLAGS) -o $@ ttyplay.o io.o compress.o %COMPRESS_ZSTD% $(LDFLAGS) $(LDLIBS)
ttytime: ttytime.o io.o compress.o %COMPRESS_ZSTD%
$(CC) $(CFLAGS) -o $@ ttytime.o io.o compress.o %COMPRESS_ZSTD% $(LDFLAGS) $(LDLIBS)
clean:
rm -f *.o $(BINARIES) ttyrecord *~
distclean: clean
rm -f Makefile configure.h
style:
uncrustify -c uncrustify.cfg -l C --no-backup *.h *.c
dist:
tar cvzf ttyrec.tar.gz *.c *.h docs/ debian/ configure Makefile.in uncrustify.cfg
install:
install -d $(DESTDIR)$(BINDIR)
install $(BINARIES) $(DESTDIR)$(BINDIR)/
install -d $(DESTDIR)$(MANDIR)/man1
install -m 0644 docs/* $(DESTDIR)$(MANDIR)/man1/
test: all
./ttyrec -V