diff options
Diffstat (limited to 'nslcd_server')
-rw-r--r-- | nslcd_server/Makefile | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/nslcd_server/Makefile b/nslcd_server/Makefile index 06fe88c..a48cb6d 100644 --- a/nslcd_server/Makefile +++ b/nslcd_server/Makefile @@ -15,24 +15,38 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA +# header +ifneq ($(topsrcdir),) +include $(topsrcdir)/build-aux/Makefile.head.mk +else +srcdir = . +.DEFAULT_GOAL = files.generate +endif + +# body + files.src.gen += func_handlerequest.go files.src.gen += interface_backend.go files.src.gen += type_nilbackend.go files.src.int += requests.txt -files.generate: $(files.src.gen) -maintainer-clean: - rm -f -- $(files.src.gen) $(files.src.int) -.PHONY: files.generate maintainer-clean +$(srcdir)/%.go: $(srcdir)/%.go.gen + cd $(@D) && ./$(^F) > $(@F) -%.go: %.go.gen - ./$^ > $@ +$(srcdir)/func_handlerequest.go: $(srcdir)/requests.txt +$(srcdir)/interface_backend.go: $(srcdir)/requests.txt +$(srcdir)/type_nilbackend.go: $(srcdir)/interface_backend.go -func_handlerequest.go: requests.txt -interface_backend.go: requests.txt -type_nilbackend.go: interface_backend.go - -requests.txt: ../nslcd_proto/nslcd_h.go Makefile +$(srcdir)/requests.txt: $(srcdir)/../nslcd_proto/nslcd_h.go $(srcdir)/Makefile < $< grep -Eo '\btype Request_([^_ ]+)(_\S+)?' | sed 's/^type Request_//' > $@ +# footer +ifneq ($(topsrcdir),) +include $(topsrcdir)/build-aux/Makefile.tail.mk +else +files.generate: $(files.src.gen) +maintainer-clean: + rm -f -- $(files.src.gen) $(files.src.int) +.PHONY: files.generate maintainer-clean .DELETE_ON_ERROR: +endif |