From 26511062524f8c437d48de4e67b79a1f102f28be Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 21 May 2015 21:54:53 +0200 Subject: build-sys: fix build with seperate builddir Let's make sure we can build rpms with this --- Makefile.am | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile.am b/Makefile.am index 090c84c01c..3821ee5eb4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1265,9 +1265,11 @@ CLEANFILES += \ $(gperf_txt_sources) %-from-name.gperf: %-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ %-from-name.h: %-from-name.gperf + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@ @@ -1276,6 +1278,7 @@ src/shared/errno-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - $@ 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 "};"}' <$< >$@ @@ -1284,6 +1287,7 @@ src/shared/af-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - $@ 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 "};"}' <$< >$@ @@ -1292,9 +1296,11 @@ src/shared/arphrd-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - $@ src/shared/arphrd-to-name.h: src/shared/arphrd-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ src/shared/arphrd-from-name.gperf: src/shared/arphrd-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@ @@ -1303,12 +1309,15 @@ src/shared/cap-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - $@ src/shared/cap-to-name.h: src/shared/cap-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@ src/shared/cap-from-name.gperf: src/shared/cap-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@ src/shared/cap-from-name.h: src/shared/cap-from-name.gperf + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@ audit_list_includes = -include linux/audit.h missing.h @@ -1321,6 +1330,7 @@ src/journal/audit_type-list.txt: $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/audit.h -include missing.h - $@ src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" } {printf " case AUDIT_%s: return \"%s\";\n", $$1, $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@ @@ -1329,9 +1339,11 @@ src/resolve/dns_type-list.txt: src/resolve/dns-type.h $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@ src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@ src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt + $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@ # ------------------------------------------------------------------------------ -- cgit v1.2.3-54-g00ecf