# Copyright (C) 2015-2016 Luke Shumaker # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA ifeq ($(origin topsrcdir),undefined) srcdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) .DEFAULT_GOAL = all else include $(topsrcdir)/build-aux/Makefile.head.mk endif std.gen_files += server/interface_backend.go std.gen_files += server/func_handlerequest.go std.gen_files += server/type_nilbackend.go std.secondary_gen_files += requests.txt $(srcdir)/requests.txt: $(srcdir)/nslcd_h.go $(srcdir)/Makefile < $< grep -Eo '\btype Request_([^_ ]+)(_\S+)?' | sed 's/^type Request_//' > $@ _nslcd.srcdir := $(srcdir) _nslcd.rel=$(patsubst $(abspath $(_nslcd.srcdir))/%,./%,$(abspath $1)) $(srcdir)/%.go: $(srcdir)/%.go.sh cd $(_nslcd.srcdir) && $(call _nslcd.rel,$^) > $(call _nslcd.rel,$@) $(srcdir)/server/interface_backend.go: $(srcdir)/requests.txt $(srcdir)/server/func_handlerequest.go: $(srcdir)/requests.txt $(srcdir)/server/type_nilbackend.go: $(srcdir)/server/interface_backend.go ifeq ($(origin topsrcdir),undefined) include $(srcdir)/common.mk else include $(topsrcdir)/build-aux/Makefile.tail.mk endif