From e424cc1c04ba380de52ae97343578c4d4e9c0738 Mon Sep 17 00:00:00 2001 From: aixiao Date: Sun, 15 Jan 2023 10:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Makefil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 12 ++++++++++-- README.md | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3733ba0..e27b173 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,19 @@ CROSS_COMPILE ?= CC := $(CROSS_COMPILE)gcc AR := $(CROSS_COMPILE)ar RANLIB := $(CROSS_COMPILE)ranlib -CMAKE := cmake + OBG = rhost CFLAGS += -Os -g -Wall -DCRON_USE_LOCAL_TIME -DCRON_TEST_MALLOC +CMAKE = $(shell if test -f /etc/centos-release; then echo "1"; else echo "0"; fi) +ifeq ("$(CMAKE)", "1") + CMAKE := cmake3 +else + CMAKE := cmake +endif + + IPTC_CFLAGS += -DHAVE_CONFIG_H -I./libiptc -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT IPTC_LIB += -lip4tc @@ -74,7 +82,7 @@ libclamav: test: - ls `echo $${PWD}` + echo $(CMAKE) static: conf.o rhost.o libiptc.o $(CC) $(IPTC_CFLAGS) -c libiptc/libip4tc.c -o libiptc/libip4tc.o diff --git a/README.md b/README.md index 74dc1c1..477e4d7 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ ``` ``` Debian + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh apt -y install libclamav-dev libip4tc-dev libcurl4-openssl-dev #(或者libcurl4-gnutls-dev) apt -y install libsystemd-dev libjson-c-dev libpcre2-dev clamav-freshclam apt -y install libltdl-dev libmspack-dev @@ -27,6 +28,7 @@ Debian ``` Centos 7 + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh yum install clamav clamav-update clamav-lib clamav-devel json-c-devel pcre2-devel yum install iptables-devel libcurl-devel yum install systemd-devel libtool-ltdl-devel libmspack-devel