Explorar o código

Merge branch 'maint'

* maint:
  makeset.sh: Allow empty lists
  Really fix 'make clean' in lib/
  lib/Makefile.in: fix make clean exit
Bryan Drewery %!s(int64=10) %!d(string=hai) anos
pai
achega
ad6f888ccf
Modificáronse 2 ficheiros con 13 adicións e 5 borrados
  1. 7 1
      build/makeset.sh
  2. 6 4
      lib/Makefile.in

+ 7 - 1
build/makeset.sh

@@ -2,15 +2,21 @@
 
 echo "/* Generated by $0 */"
 needcomma=0
+printedtype=0
 while read -r line; do
 	[ -z "${line%%#*}" ] && continue # skip comments
+	# :type/:end
 	if [ -n "${line}" -a -z "${line%%:*}" ]; then
-		[ ${needcomma} -eq 1 ] && printf "\"\n\n"
+		# Close out the last type.
+		[ ${printedtype} -eq 1 ] && printf "%c\n\n" '"'
 		type="${line#:}"
 		[ "${type}" = "end" ] && break
 		printf "#define DEFAULT_%s \"%c\n" $(echo "${type}" | tr '[:lower:]' '[:upper:]') '\'
 		needcomma=0
+		printedtype=1
 	else
+	# entry
+		# Comma-separate the last entry.
 		[ ${needcomma} -eq 1 ] && printf ",%c\n" '\'
 		printf "%s" "${line}"
 		needcomma=1

+ 6 - 4
lib/Makefile.in

@@ -16,14 +16,16 @@ default: normal
 
 clean:
 	-+@cd bdlib && $(MAKE) clean
-	-+@[ -n "${LIBELF_BUNDLED}" ] && [ -f libelf/Makefile && \
-	    cd libelf && $(MAKE) clean
+	-+@if [ -n "${LIBELF_BUNDLED}" ] && [ -f libelf/Makefile ]; then \
+	    cd libelf && $(MAKE) clean; \
+	   fi
 	@rm -f *.a
 
 distclean: clean
 	-+@cd bdlib && $(MAKE) distclean
-	-+@[ -n "${LIBELF_BUNDLED}" ] && [ -f libelf/Makefile ] && \
-	    cd libelf && $(MAKE) distclean
+	-+@if [ -n "${LIBELF_BUNDLED}" ] && [ -f libelf/Makefile ]; then \
+	    cd libelf && $(MAKE) distclean; \
+	   fi
 
 notice:
 	@echo "[*] Making libraries"