This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
forked from jgarzik/univalue
-
Notifications
You must be signed in to change notification settings - Fork 28
Split sources for easier buildsystem integration #19
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# - All variables are namespaced with UNIVALUE_ to avoid colliding with | ||
# downstream makefiles. | ||
# - All Variables ending in _HEADERS or _SOURCES confuse automake, so the | ||
# _INT postfix is applied. | ||
# - Convenience variables, for example a UNIVALUE_TEST_DIR should not be used | ||
# as they interfere with automatic dependency generation | ||
# - The %reldir% is the relative path from the Makefile.am. This allows | ||
# downstreams to use these variables without having to manually account for | ||
# the path change. | ||
|
||
UNIVALUE_INCLUDE_DIR_INT = %reldir%/include | ||
|
||
UNIVALUE_DIST_HEADERS_INT = | ||
UNIVALUE_DIST_HEADERS_INT += %reldir%/include/univalue.h | ||
|
||
UNIVALUE_LIB_HEADERS_INT = | ||
UNIVALUE_LIB_HEADERS_INT += %reldir%/lib/univalue_utffilter.h | ||
UNIVALUE_LIB_HEADERS_INT += %reldir%/lib/univalue_escapes.h | ||
|
||
UNIVALUE_LIB_SOURCES_INT = | ||
UNIVALUE_LIB_SOURCES_INT += %reldir%/lib/univalue.cpp | ||
UNIVALUE_LIB_SOURCES_INT += %reldir%/lib/univalue_get.cpp | ||
UNIVALUE_LIB_SOURCES_INT += %reldir%/lib/univalue_read.cpp | ||
UNIVALUE_LIB_SOURCES_INT += %reldir%/lib/univalue_write.cpp | ||
|
||
UNIVALUE_TEST_DATA_DIR_INT = %reldir%/test | ||
|
||
UNIVALUE_TEST_UNITESTER_INT = | ||
UNIVALUE_TEST_UNITESTER_INT += %reldir%/test/unitester.cpp | ||
|
||
UNIVALUE_TEST_JSON_INT = | ||
UNIVALUE_TEST_JSON_INT += %reldir%/test/test_json.cpp | ||
|
||
UNIVALUE_TEST_NO_NUL_INT = | ||
UNIVALUE_TEST_NO_NUL_INT += %reldir%/test/no_nul.cpp | ||
|
||
UNIVALUE_TEST_OBJECT_INT = | ||
UNIVALUE_TEST_OBJECT_INT += %reldir%/test/object.cpp | ||
|
||
UNIVALUE_TEST_FILES_INT = | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail1.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail2.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail3.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail4.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail5.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail6.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail7.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail8.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail9.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail10.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail11.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail12.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail13.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail14.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail15.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail16.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail17.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail18.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail19.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail20.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail21.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail22.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail23.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail24.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail25.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail26.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail27.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail28.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail29.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail30.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail31.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail32.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail33.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail34.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail35.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail36.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail37.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail38.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail39.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail40.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail41.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail42.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail44.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/fail45.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/pass1.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/pass2.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/pass3.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/pass4.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round1.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round2.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round3.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round4.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round5.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round6.json | ||
UNIVALUE_TEST_FILES_INT += %reldir%/test/round7.json |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
FORCE
doing anything? As far as I understand,FORCE
has no special meaning and by convention is used for a target that doesn't have any prerequisites or recipe, and is therefore always run: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html#Force-Targets. I think the intention is to make sure that$(GENBIN)
is always rebuilt, but I have some questions:FORCE:
target defined for this to work? The various examples I've seen have always included an emptyFORCE:
target.$(GENBIN)
, then shouldn'tFORCE
be a dependency of$(GENBIN)
? If it's a dependency ofgen
, thengen
will get rereun, but it might be using an old version of$(GENBIN)
..INTERMEDIATE: $(GENBIN)
mean that$(GENBIN)
will be deleted at the end of the make anyway, and will therefore be rebuilt on eachmake gen
?gen
isPHONY
mean that it'll be run everymake gen
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FORCE is a phony variable here used to make gen always run. (But leaving it undeclared would work too, it would still just always run because it would never complete its goal of generating a file called
FORCE
)The intention is for
$(GENBIN)
to be a real target, and forgen
to be a phony convenience target that always rebuilds the header.Yup!
Yup!
The idea here is that "gen" is a convenience target for regenerating the univalue_escapes.h file. It is never run automatically, it is just a way to generate a header that's committed to the repo. As such, when a user does
make gen
, it should always regenerate the file. The current behavior of depending on its own output is broken.There's no reason to ever keep $(GENBIN) around, so it's an intermediate.
make gen
essentially never needs to be used, it's possible that its only use is to demonstrate how the .h was generated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @theuni! All makes sense.