优化Makefil

This commit is contained in:
aixiao 2023-01-15 10:33:54 +08:00
parent 45fe15f472
commit e424cc1c04
2 changed files with 12 additions and 2 deletions

View File

@ -2,11 +2,19 @@ CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc CC := $(CROSS_COMPILE)gcc
AR := $(CROSS_COMPILE)ar AR := $(CROSS_COMPILE)ar
RANLIB := $(CROSS_COMPILE)ranlib RANLIB := $(CROSS_COMPILE)ranlib
CMAKE := cmake
OBG = rhost OBG = rhost
CFLAGS += -Os -g -Wall -DCRON_USE_LOCAL_TIME -DCRON_TEST_MALLOC 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_CFLAGS += -DHAVE_CONFIG_H -I./libiptc -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT
IPTC_LIB += -lip4tc IPTC_LIB += -lip4tc
@ -74,7 +82,7 @@ libclamav:
test: test:
ls `echo $${PWD}` echo $(CMAKE)
static: conf.o rhost.o libiptc.o static: conf.o rhost.o libiptc.o
$(CC) $(IPTC_CFLAGS) -c libiptc/libip4tc.c -o libiptc/libip4tc.o $(CC) $(IPTC_CFLAGS) -c libiptc/libip4tc.c -o libiptc/libip4tc.o

View File

@ -11,6 +11,7 @@
``` ```
``` ```
Debian 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 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 libsystemd-dev libjson-c-dev libpcre2-dev clamav-freshclam
apt -y install libltdl-dev libmspack-dev apt -y install libltdl-dev libmspack-dev
@ -27,6 +28,7 @@ Debian
``` ```
Centos 7 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 clamav clamav-update clamav-lib clamav-devel json-c-devel pcre2-devel
yum install iptables-devel libcurl-devel yum install iptables-devel libcurl-devel
yum install systemd-devel libtool-ltdl-devel libmspack-devel yum install systemd-devel libtool-ltdl-devel libmspack-devel