mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-04 04:58:21 +03:00
build-sys: use a common rule for some gperf commands
This commit is contained in:
parent
23432a1c24
commit
fd00a08821
34
Makefile.am
34
Makefile.am
@ -1156,37 +1156,27 @@ BUILT_SOURCES += \
|
|||||||
src/shared/af-from-name.h \
|
src/shared/af-from-name.h \
|
||||||
src/shared/af-to-name.h
|
src/shared/af-to-name.h
|
||||||
|
|
||||||
|
src/shared/%-from-name.gperf: src/shared/%-list.txt
|
||||||
|
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $*_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
|
||||||
|
|
||||||
|
src/shared/%-from-name.h: src/shared/%-from-name.gperf
|
||||||
|
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$* -H hash_$*_name -p -C <$< >$@
|
||||||
|
|
||||||
|
|
||||||
src/shared/errno-list.txt:
|
src/shared/errno-list.txt:
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
||||||
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' > $@
|
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
|
||||||
|
|
||||||
src/shared/errno-from-name.gperf: src/shared/errno-list.txt
|
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
|
||||||
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
|
|
||||||
|
|
||||||
src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
|
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
|
||||||
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
|
|
||||||
|
|
||||||
src/shared/errno-to-name.h: src/shared/errno-list.txt
|
src/shared/errno-to-name.h: src/shared/errno-list.txt
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
|
||||||
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
|
|
||||||
|
|
||||||
src/shared/af-list.txt:
|
src/shared/af-list.txt:
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
||||||
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - < /dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' > $@
|
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@
|
||||||
|
|
||||||
src/shared/af-from-name.gperf: src/shared/af-list.txt
|
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
|
||||||
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct af_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
|
|
||||||
|
|
||||||
src/shared/af-from-name.h: src/shared/af-from-name.gperf
|
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
|
||||||
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_af -H hash_af_name -p -C < $< > $@
|
|
||||||
|
|
||||||
src/shared/af-to-name.h: src/shared/af-list.txt
|
src/shared/af-to-name.h: src/shared/af-list.txt
|
||||||
$(AM_V_at)$(MKDIR_P) $(dir $@)
|
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
|
||||||
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
systemd_SOURCES = \
|
systemd_SOURCES = \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user