forked from mysecureshell/mysecureshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
142 lines (114 loc) · 3.94 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
VERSION = @PACKAGE_VERSION@
DEST = mysecureshell_$(VERSION)
CPU = "`uname -m`"
ARCHIVE = mysecureshell_$(VERSION)-$(OSTYPE)-$(CPU)
ARCSRC = mysecureshell_$(VERSION).tar.gz
NAME = mysecureshell$(EXT)
SRC = Core/main.c Core/string.c \
Core/parsing.c Core/hash.c \
Core/conf.c Core/convert.c \
Core/user.c Core/prog.c \
Core/ip.c Core/FileSpec.c \
SftpServer/Buffer.c SftpServer/Encode.c \
SftpServer/Handle.c SftpServer/Send.c \
SftpServer/Sftp.c SftpServer/Util.c \
SftpServer/Log.c SftpServer/Encoding.c \
SftpServer/Admin.c SftpServer/SftpWho.c \
SftpServer/SftpExt.c SftpServer/SftpServer.c \
SftpServer/GetUsersInfos.c SftpServer/Stats.c \
SftpServer/Access.c SftpServer/FileSystem.c \
SftpServer/FileSystemAcl.c
OBJ = $(SRC:.c=.o)
NAME1 = utils/sftp-who$(EXT)
SRC1 = SftpWho/Main.c SftpServer/SftpWho.c \
Core/conf.c Core/convert.c Core/hash.c \
Core/user.c Core/parsing.c Core/string.c \
Core/ip.c Core/FileSpec.c SftpServer/Access.c
OBJ1 = $(SRC1:.c=.o)
NAME2 = utils/sftp-state$(EXT)
SRC2 = SftpState/Main.c SftpServer/SftpWho.c
OBJ2 = $(SRC2:.c=.o)
NAME3 = utils/sftp-admin$(EXT)
SRC3 = SftpAdmin/Main.c SftpServer/Buffer.c SftpServer/Log.c
OBJ3 = $(SRC3:.c=.o)
FILE = utils/sftp-user utils/sftp-kill utils/sftp-verif \
README-fr README-en install.sh locales_en locales_fr \
uninstaller.sh sftp_config LICENSE man/*/man8/*.8
FILESRC = $(DEST)/sftp_config $(DEST)/utils/sftp-kill $(DEST)/LICENSE \
$(DEST)/README-fr $(DEST)/README-en $(DEST)/Makefile.in \
$(DEST)/config.h.in $(DEST)/configure $(DEST)/install.sh.in \
$(DEST)/uninstaller.sh.in $(DEST)/locales_en $(DEST)/locales_fr\
$(DEST)/utils/sftp-verif.in $(DEST)/utils/sftp-user.in \
$(DEST)/man/*/man8/*.8
CFLAGS = -Wall -Wunused -Wpointer-arith -Wno-uninitialized -O2 -ISftpServer @CFLAGS@ @CPPFLAGS@ @MSS_DEBUG@
LDFLAGS = @LDFLAGS@ @LIBS@ @LINKER_OPT@
CC = @CC@
EXT = @EXEEXT@
RM = rm -f
CHMOD = chmod
TAR = tar
CP = cp -pf
STRIP = strip
FIND = find
LN = ln
LS = ls
SPLINT = splint -Du_int16_t=uint16_t -Du_int32_t=uint32_t -Du_int64_t=uint64_t -Du_int8_t=uint8_t +posixlib
all : $(NAME) $(NAME1) $(NAME2) $(NAME3)
$(NAME) : $(OBJ)
@echo "Compile binary [$(NAME)]"
@$(CC) -o $(NAME) $(OBJ) $(LDFLAGS)
@$(CHMOD) 755 $(NAME)
$(NAME1) : $(OBJ1)
@echo "Compile binary [$(NAME1)]"
@$(CC) -o $(NAME1) $(OBJ1) $(LDFLAGS)
@$(CHMOD) 711 $(NAME1)
$(NAME2) : $(OBJ2)
@echo "Compile binary [$(NAME2)]"
@$(CC) -o $(NAME2) $(OBJ2) $(LDFLAGS)
@$(CHMOD) 711 $(NAME2)
$(NAME3) : $(OBJ3)
@echo "Compile binary [$(NAME3)]"
@$(CC) -o $(NAME3) $(OBJ3) $(LDFLAGS)
@$(CHMOD) 711 $(NAME3)
clean :
@echo "Delete all objects"
@$(RM) $(OBJ) $(OBJ1) $(OBJ2) $(OBJ3)
@$(RM) config.status config.log install.sh uninstaller.sh config.h utils/sftp-user utils/sftp-verif Makefile
distclean: clean
@echo "Delete all unecessary files"
@$(RM) $(NAME) $(NAME1) $(NAME2) $(NAME3)
@$(RM) -i `$(FIND) . | grep -F '~'` *.tgz || true
updateautoconf:
/usr/bin/autoscan
/usr/bin/autoheader
/usr/bin/automake --force-missing --add-missing
/usr/bin/autoconf -f
cleanautoconf:
@$(RM) config.h Makefile configure
mrproper: distclean cleanautoconf
install : all
@./install.sh yesall $(DESTDIR)
re : distclean all
package : re
@echo "Make package"
@$(STRIP) $(NAME) $(NAME1) $(NAME2) $(NAME3)
@echo "Tar package"
@$(TAR) cfz $(ARCHIVE).tgz $(NAME) $(NAME1) $(NAME2) $(NAME3) $(FILE)
@echo "Package done."
source :
@echo "Tar the world"
@test -e ../$(DEST) || $(LN) -fs mysecureshell ../$(DEST)
@cd .. && $(TAR) cfz $(DEST)/$(ARCSRC) $(FILESRC) $(DEST)/*.[ch] $(DEST)/*/*.[ch]
@echo "Source package done."
files :
@test -e ../$(DEST) || $(LN) -fs mysecureshell ../$(DEST)
@cd .. && $(LS) $(FILESRC) $(DEST)/*.[ch] $(DEST)/*/*.[ch]
check :
@echo "Check sources"
@$(SPLINT) -ISftpServer $(SRC) || true
@$(SPLINT) -ISftpServer $(SRC1) || true
@$(SPLINT) -ISftpServer $(SRC2) || true
@$(SPLINT) -ISftpServer $(SRC3) || true
.c.o :
@echo "Compile [$<]"
@$(CC) $(CFLAGS) -c -o $@ $<