Patchwork D7568: fuzz: clean up some repetition on building parsers.so fuzzers

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2019, 4:04 a.m.
Message ID <5dbee4d00124ca56478392c5c7c1b3b3@localhost.localdomain>
Download mbox | patch
Permalink /patch/43627/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2019, 4:04 a.m.
Closed by commit rHGceeff2d99cc9: fuzz: clean up some repetition on building parsers.so fuzzers (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7568?vs=18506&id=18519

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7568/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7568

AFFECTED FILES
  contrib/fuzz/Makefile

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mjpieters, mercurial-devel

Patch

diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -56,98 +56,74 @@ 
 	  fuzz-xdiffi.o fuzz-xprepare.o fuzz-xutils.o \
 	  $(LIB_FUZZING_ENGINE) -o $$OUT/xdiff_fuzzer
 
-manifest.o: ../../mercurial/cext/manifest.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o manifest.o ../../mercurial/cext/manifest.c
-
-charencode.o: ../../mercurial/cext/charencode.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o charencode.o ../../mercurial/cext/charencode.c
-
-parsers.o: ../../mercurial/cext/parsers.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o parsers.o ../../mercurial/cext/parsers.c
+parsers-%.o: ../../mercurial/cext/%.c
+	$(CC) -I../../mercurial `$(PYTHON_CONFIG) --cflags` $(CFLAGS) -c \
+	  -o $@ $<
 
-dirs.o: ../../mercurial/cext/dirs.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o dirs.o ../../mercurial/cext/dirs.c
+PARSERS_OBJS=parsers-manifest.o parsers-charencode.o parsers-parsers.o parsers-dirs.o parsers-pathencode.o parsers-revlog.o
 
-pathencode.o: ../../mercurial/cext/pathencode.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o pathencode.o ../../mercurial/cext/pathencode.c
-
-revlog.o: ../../mercurial/cext/revlog.c
-	$(CC) $(CFLAGS) `$(PYTHON_CONFIG) --cflags` \
-	  -I../../mercurial \
-	  -c -o revlog.o ../../mercurial/cext/revlog.c
-
-dirs_fuzzer: dirs.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial dirs.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/dirs_fuzzer
 
-fncache_fuzzer: fncache.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+fncache_fuzzer: fncache.cc 
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial fncache.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/fncache_fuzzer
 
-jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial jsonescapeu8fast.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/jsonescapeu8fast_fuzzer
 
 manifest_corpus.zip:
 	python manifest_corpus.py $$OUT/manifest_fuzzer_seed_corpus.zip
 
-manifest_fuzzer: manifest.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial manifest.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/manifest_fuzzer
 
-revlog_fuzzer: revlog.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial revlog.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/revlog_fuzzer
 
 revlog_corpus.zip:
 	python revlog_corpus.py $$OUT/revlog_fuzzer_seed_corpus.zip
 
-dirstate_fuzzer: dirstate.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial dirstate.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/dirstate_fuzzer
 
 dirstate_corpus.zip:
 	python dirstate_corpus.py $$OUT/dirstate_fuzzer_seed_corpus.zip
 
-fm1readmarkers_fuzzer: fm1readmarkers.cc manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o
+fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS)
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial fm1readmarkers.cc \
-	  manifest.o charencode.o parsers.o dirs.o pathencode.o revlog.o pyutil.o \
+	  pyutil.o $(PARSERS_OBJS) \
 	  $(LIB_FUZZING_ENGINE) `$(PYTHON_CONFIG) --ldflags` \
 	  -o $$OUT/fm1readmarkers_fuzzer