-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.in
93 lines (72 loc) · 2.42 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
AR = @AR@
RANLIB = @RANLIB@
CC = @CC@
CFLAGS = @CFLAGS@ -fPIC -I@srcdir@/src -I@srcdir@/src/include -I@srcdir@/src/include/crypt4gh @DEFS@
LIBS = @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
LIBDIR = @libdir@
INCLUDEDIR = @includedir@
PKGCONFIGDIR = $(LIBDIR)/pkgconfig
ifdef DEBUG
CFLAGS += -DDEBUG=$(DEBUG) -g
endif
C4GH_LD_SONAME = #-Wl,-soname,libcrypt4gh.so.2
C4GH_OBJECTS = src/header.o src/packet.o src/segment.o src/payload.o src/stream.o src/err.o src/crypt4gh.o
.PHONY: all clean install
.SUFFIXES: .c .o
all: libcrypt4gh.so libcrypt4gh.la
$(LIBDIR) $(INCLUDEDIR) $(PKGCONFIGDIR):
@echo "Creating: $@"
@install -d $@
libcrypt4gh.so: $(C4GH_OBJECTS)
@echo "Linking objects into $@"
@$(CC) -shared $(C4GH_LD_SONAME) -o $@ $(LIBS) $(C4GH_OBJECTS)
libcrypt4gh.la: $(C4GH_OBJECTS)
$(AR) rv $@ $(C4GH_OBJECTS)
$(RANLIB) $@
%.o: %.c
ifdef DEBUG
@echo "Compiling $< (debug: $(DEBUG))"
else
@echo "Compiling $<"
endif
@$(CC) $(CFLAGS) -c -o $@ $<
install-so: libcrypt4gh.so | $(LIBDIR)
@echo "Installing $< into $(LIBDIR)"
@install -m 755 $< $(LIBDIR)
install-la: libcrypt4gh.la | $(LIBDIR)
@echo "Installing $< into $(LIBDIR)"
@install -m 755 $< $(LIBDIR)
install-pc: libcrypt4gh.pc | $(PKGCONFIGDIR)
@echo "Installing $< into $(PKGCONFIGDIR)"
@install -m 644 $< $(PKGCONFIGDIR)
install-includes: src/include | $(INCLUDEDIR)
@echo "Installing header files into $(INCLUDEDIR)"
@cp -r $</* $(INCLUDEDIR)
# Todo: use "install" instead of cp
install: install-so install-la install-pc install-includes
clean:
-rm -f libcrypt4gh.so libcrypt4gh.la $(C4GH_OBJECTS)
-@rm -f *~
distclean: clean
-rm -f Makefile src/config.h* config.status configure config.log
-rm -rf autom4te.cache src/.depend.old libcrypt4gh.pc
###################################
## Dependencies
###################################
depend: depend-rebuild
rm -f src/.depend.bak
depend-rebuild:
mv src/.depend src/.depend.old
rm -f src/config.h src/.depend
touch src/config.h src/.depend
makedepend -w1000 -I@srcdir@/src -I@srcdir@/src/include -I@srcdir@/src/include/crypt4gh @DEFS@ -Ysrc -f src/.depend src/*.c 2>/dev/null
(echo '# Automatically generated by makedepend.'; \
echo '# Run "make depend" to rebuild.'; sort src/.depend ) >src/.depend.tmp
mv src/.depend.tmp src/.depend
rm -f src/.depend.bak
mv src/.depend.old src/.depend.bak
depend-check: depend-rebuild
cmp src/.depend src/.depend.bak || (echo src/.depend stale && exit 1)
# @DEPEND@