"Fossies" - the Fresh Open Source Software Archive

Member "geoipupdate-4.3.0/Makefile" (16 Apr 2020, 1849 Bytes) of package /linux/misc/geoipupdate-4.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ifndef BUILDDIR
    2 BUILDDIR=build
    3 endif
    4 
    5 ifndef CONFFILE
    6 ifeq ($(OS),Windows_NT)
    7 CONFFILE=%SystemDrive%\ProgramData\MaxMind\GeoIPUpdate\GeoIP.conf
    8 else
    9 CONFFILE=/usr/local/etc/GeoIP.conf
   10 endif
   11 endif
   12 
   13 ifndef DATADIR
   14 ifeq ($(OS),Windows_NT)
   15 DATADIR=%SystemDrive%\ProgramData\MaxMind\GeoIPUpdate\GeoIP
   16 else
   17 DATADIR=/usr/local/share/GeoIP
   18 endif
   19 endif
   20 
   21 ifeq ($(OS),Windows_NT)
   22 MAYBE_CR=\r
   23 endif
   24 
   25 ifndef VERSION
   26 VERSION=unknown
   27 endif
   28 
   29 all: \
   30 	$(BUILDDIR)/geoipupdate \
   31 	data
   32 
   33 data: \
   34 	$(BUILDDIR)/GeoIP.conf \
   35 	$(BUILDDIR)/GeoIP.conf.md \
   36 	$(BUILDDIR)/geoipupdate.md \
   37 	$(BUILDDIR)/GeoIP.conf.5 \
   38 	$(BUILDDIR)/geoipupdate.1
   39 
   40 $(BUILDDIR):
   41 	mkdir -p $(BUILDDIR)
   42 
   43 $(BUILDDIR)/geoipupdate: $(BUILDDIR)
   44 	(cd cmd/geoipupdate && go build -ldflags '-X main.defaultConfigFile=$(CONFFILE) -X main.defaultDatabaseDirectory=$(DATADIR) -X "main.version=$(VERSION)"')
   45 	cp cmd/geoipupdate/geoipupdate $(BUILDDIR)
   46 
   47 $(BUILDDIR)/GeoIP.conf: $(BUILDDIR) conf/GeoIP.conf.default
   48 	sed -e 's|CONFFILE|$(CONFFILE)|g' -e 's|DATADIR|$(DATADIR)|g' -e 's|$$|$(MAYBE_CR)|g' conf/GeoIP.conf.default > $(BUILDDIR)/GeoIP.conf
   49 
   50 $(BUILDDIR)/GeoIP.conf.md: $(BUILDDIR) doc/GeoIP.conf.md
   51 	sed -e 's|CONFFILE|$(CONFFILE)|g' -e 's|DATADIR|$(DATADIR)|g' -e 's|$$|$(MAYBE_CR)|g' doc/GeoIP.conf.md > $(BUILDDIR)/GeoIP.conf.md
   52 
   53 $(BUILDDIR)/geoipupdate.md: $(BUILDDIR) doc/geoipupdate.md
   54 	sed -e 's|CONFFILE|$(CONFFILE)|g' -e 's|DATADIR|$(DATADIR)|g' -e 's|$$|$(MAYBE_CR)|g' doc/geoipupdate.md > $(BUILDDIR)/geoipupdate.md
   55 
   56 $(BUILDDIR)/GeoIP.conf.5: $(BUILDDIR)/GeoIP.conf.md  $(BUILDDIR)/geoipupdate.md
   57 	dev-bin/make-man-pages.pl "$(BUILDDIR)"
   58 
   59 $(BUILDDIR)/geoipupdate.1: $(BUILDDIR)/GeoIP.conf.5
   60 
   61 clean:
   62 	rm -rf $(BUILDDIR)/GeoIP.conf \
   63 		   $(BUILDDIR)/GeoIP.conf.md \
   64 		   $(BUILDDIR)/geoipupdate \
   65 		   $(BUILDDIR)/geoipupdate.md \
   66 		   $(BUILDDIR)/GeoIP.conf.5 \
   67 		   $(BUILDDIR)/geoipupdate.1