Fix update-unicode target
authorPeter Eisentraut <[email protected]>
Sun, 19 Apr 2020 12:59:29 +0000 (14:59 +0200)
committerPeter Eisentraut <[email protected]>
Sun, 19 Apr 2020 12:59:29 +0000 (14:59 +0200)
The normalization-check target needs to be run last, after moving the
newly generated files into place.  Also, we need an additional
dependency so that unicode_norm.o is rebuilt first.  Otherwise,
norm_test will still test the old files but against the new expected
results, which will probably fail.

src/common/unicode/Makefile

index 7a37ec7b55af42c21096feb4493bc28073e9ba28..93a9d1615f1c1379c90bbb9d0dcff38caffbd82a 100644 (file)
@@ -19,8 +19,8 @@ LIBS += $(PTHREAD_LIBS)
 all:
 
 update-unicode: unicode_norm_table.h unicode_combining_table.h unicode_normprops_table.h
-       $(MAKE) normalization-check
        mv $^ ../../../src/include/common/
+       $(MAKE) normalization-check
 
 # These files are part of the Unicode Character Database. Download
 # them on demand.  The dependency on Makefile.global is for
@@ -43,10 +43,15 @@ unicode_normprops_table.h: generate-unicode_normprops_table.pl DerivedNormalizat
 normalization-check: norm_test
        ./norm_test
 
-norm_test: norm_test.o ../unicode_norm.o
+norm_test: norm_test.o ../unicode_norm.o | submake-common
 
 norm_test.o: norm_test_table.h
 
+.PHONY: submake-common
+
+submake-common:
+       $(MAKE) -C .. all
+
 norm_test_table.h: generate-norm_test_table.pl NormalizationTest.txt
        perl generate-norm_test_table.pl NormalizationTest.txt $@