put master_ctl into rpm package.

This commit is contained in:
zhengshuxin 2017-08-01 13:41:36 +08:00
parent 91236bd108
commit b0b08bf3ef
2 changed files with 21 additions and 10 deletions

View File

@ -135,6 +135,7 @@ packinstall:
$(shell mkdir -p ./dist/master/libexec/$(RPATH))
@(cd app/master/daemon; make install)
@(cd app/master/tools/master_ctld; make install)
@(cd app/master/tools/master_ctl; make install)
cp -f app/master/daemon/acl_master $(BIN_PATH)
(cd dist/master && ./setup.sh $(DESTDIR) /opt/soft/acl-master)
cp -Rf lib_acl/include/* $(INC_ACL)/acl/

View File

@ -10,14 +10,15 @@ CFLAGS = -c -g -W -Wall -Wcast-qual -Wcast-align \
# Linux, SunOS, Solaris, BSD variants, AIX, HP-UX
SYSLIB = -lreadline -lcurses -lpthread -lz
CHECKSYSRES = @echo "Unknow system type!";exit 1
UNIXNAME = $(shell uname -sm)
OSNAME = $(shell uname -s)
OSTYPE = $(shell uname -m)
ifeq ($(CC),)
CC = gcc
endif
# For FreeBSD
ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD)
ifeq ($(findstring FreeBSD, $(OSNAME)), FreeBSD)
ifeq ($(findstring gcc, $(CC)), gcc)
CFLAGS += -Wstrict-prototypes
endif
@ -26,7 +27,7 @@ ifeq ($(findstring FreeBSD, $(UNIXNAME)), FreeBSD)
endif
# For Darwin
ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-extended-offsetof
UNIXTYPE = MACOSX
@ -34,7 +35,13 @@ ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
endif
#Path for Linux
ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
ifeq ($(findstring Linux, $(OSNAME)), Linux)
ifeq ($(findstring i686, $(OSTYPE)), i686)
RPATH = linux32
endif
ifeq ($(findstring x86_64, $(OSTYPE)), x86_64)
RPATH = linux64
endif
ifeq ($CC, "gcc")
CFLAGS += -Wstrict-prototypes
endif
@ -43,25 +50,25 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
#Path for SunOS
ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS)
ifeq ($(findstring 86, $(UNIXNAME)), 86)
ifeq ($(findstring SunOS, $(OSNAME)), SunOS)
ifeq ($(findstring 86, $(OSTYPE), 86)
SYSLIB += -lsocket -lnsl -lrt
endif
ifeq ($(findstring sun4u, $(UNIXNAME)), sun4u)
ifeq ($(findstring sun4u, $(OSTYPE), sun4u)
SYSLIB += -lsocket -lnsl -lrt
endif
ifeq ($CC, "gcc")
@ -71,7 +78,7 @@ ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS)
endif
#Path for HP-UX
ifeq ($(findstring HP-UX, $(UNIXNAME)), HP-UX)
ifeq ($(findstring HP-UX, $(OSNAME)), HP-UX)
ifeq ($CC, "gcc")
CFLAGS += -Wstrict-prototypes
endif
@ -126,4 +133,7 @@ clean:
rm -f $(PROG)
rm -f $(OBJ)
rebuild rb: clean all
install:
@mkdir -p ../../../../dist/master/bin/$(RPATH)
cp $(PROG) ../../../../dist/master/bin/$(RPATH)/
###########################################################