MSSQL loadable plugin
Source
5
5
6
6
ifeq ($(OS),Windows_NT)
7
7
GOOS := windows
8
8
SHELL := cmd
9
9
TOPDIR := $(subst /,\,$(CURDIR))
10
10
PACKAGE:=$(PACKAGE).exe
11
11
WINDRES = windres.exe
12
12
ifneq ("$(shell findstr ZABBIX_RC_NUM $(TOPDIR)\windres\resource.h)","")
13
13
ifeq ("$(WINDRES_FLAGS)","")
14
14
WINDRES_FLAGS := \
15
-
-D ZABBIX_LICENSE_YEARS='\"$(word 3,$(shell findstr Copyright $(TOPDIR)\main.go | findstr 2001-20))\"' \
15
+
-D ZABBIX_LICENSE_YEARS='\"$(word 4,$(shell findstr Copyright $(TOPDIR)\main.go | findstr 2001-20))\"' \
16
16
-D ZABBIX_VERSION_MAJOR=$(lastword $(shell findstr VERSION_MAJOR $(TOPDIR)\main.go | findstr =)) \
17
17
-D ZABBIX_VERSION_MINOR=$(lastword $(shell findstr VERSION_MINOR $(TOPDIR)\main.go | findstr =)) \
18
18
-D ZABBIX_VERSION_PATCH=$(lastword $(shell findstr VERSION_PATCH $(TOPDIR)\main.go | findstr =)) \
19
19
-D ZABBIX_VERSION_RC='\"$(lastword $(shell findstr VERSION_RC $(TOPDIR)\main.go | findstr =))\"' \
20
20
-D ZABBIX_VERSION_RC_NUM=1000
21
21
endif
22
22
endif
23
23
24
24
RFLAGS := $(RFLAGS) --input-format=rc -O coff
25
25
111
111
go fmt "$(TOPDIR)/..."
112
112
113
113
dist:
114
114
ifneq ($(OS),Windows_NT)
115
115
cd $(TOPDIR); \
116
116
go mod vendor; \
117
117
major_verison=$(lastword $(shell grep 'PLUGIN_VERSION_MAJOR =' ./main.go)); \
118
118
minor_verison=$(lastword $(shell grep 'PLUGIN_VERSION_MINOR =' ./main.go)); \
119
119
patch_verison=$(lastword $(shell grep 'PLUGIN_VERSION_PATCH =' ./main.go)); \
120
120
alphatag=$(lastword $(shell grep 'PLUGIN_VERSION_RC =' ./main.go)); \
121
-
lic_years=$(word 3, $(shell grep ' Copyright 2001-' ./main.go)); \
121
+
lic_years=$(word 4, $(shell grep ' Copyright (C) 2001-' ./main.go)); \
122
122
distdir="$(PACKAGE)-$${major_verison}.$${minor_verison}.$${patch_verison}$${alphatag}"; \
123
123
dist_archive="$${distdir}.tar.gz"; \
124
124
mkdir -p ./$${distdir}; \
125
125
for distfile in '$(DISTFILES)'; do \
126
126
cp -fp ./$${distfile} ./$${distdir}/; \
127
127
done; \
128
128
for subdir in '$(DIST_SUBDIRS)'; do \
129
129
cp -fpR ./$${subdir} ./$${distdir}; \
130
130
done; \
131
131
# File revision number must be numeric (Git commit hash cannot be used).