-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.24 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
48
49
50
51
52
53
54
55
56
#
# Makefile for jsh
#
SRC = ./src
INC = -I./src
LIB =
BIN = /usr/local/bin
ETC = /usr/local/etc
JSHDIR = $(ETC)/jsh.d
SAMPLE = group.jailed.conf
MANCONF = man.conf
BANNER = banner.txt
PORTCONF = port.conf
SFTPBYPASS = sftp.bypass
CFLAGS := -O2 -Wall -Wno-unused-but-set-variable -g $(INC)
CC := gcc
AR := ar
RM := rm -rf
CP := cp -rf
default: jsh
OBJS = $(SRC)/jsh.o $(SRC)/utils.o $(SRC)/mylex.o $(SRC)/jtrace.o $(SRC)/man.o
jsh: $(OBJS)
$(CC) -o $@ $^ /usr/local/lib/libocli.a -lpcre -lreadline
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
man.h:
$(SRC)/grabman.py > $(SRC)/man.h
install:
install -m 755 -o root -g root jsh $(BIN)
ifeq ($(wildcard $(JSHDIR)/$(SAMPLE)),)
install -m 644 -o root -g root -D conf/$(SAMPLE) $(JSHDIR)/$(SAMPLE)
endif
ifeq ($(wildcard $(JSHDIR)/$(MANCONF)),)
install -m 644 -o root -g root -D conf/$(MANCONF) $(JSHDIR)/$(MANCONF)
endif
ifeq ($(wildcard $(JSHDIR)/$(BANNER)),)
install -m 644 -o root -g root -D conf/$(BANNER) $(JSHDIR)/$(BANNER)
endif
ifeq ($(wildcard $(JSHDIR)/$(PORTCONF)),)
install -m 644 -o root -g root -D conf/$(PORTCONF) $(JSHDIR)/$(PORTCONF)
endif
ifeq ($(wildcard $(JSHDIR)/$(SFTPBYPASS)),)
install -m 644 -o root -g root -D conf/$(SFTPBYPASS) $(JSHDIR)/$(SFTPBYPASS)
endif
clean:
$(RM) jsh $(SRC)/*.o