aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-05-15 11:44:35 -0400
committerGitHub <noreply@github.com>2023-05-15 11:44:35 -0400
commitf8a6a9e47314acebea2d72c0ec195360eb58bbec (patch)
treea82a03f0d9d9088bd4e33d88af06b549861a7a36
parent41591b33a9526dbf91232fa920903b9ccd2b3396 (diff)
parentf7c896cfd80b511c30be5452edb0a350a7dd253c (diff)
Merge pull request #8341 from obsidiansystems/dedup-gen-hh
Dedup some markdown -> C++ big literal stuff in build system
-rw-r--r--mk/cxx-big-literal.mk5
-rw-r--r--mk/lib.mk1
-rw-r--r--src/libstore/local.mk6
-rw-r--r--src/nix/local.mk8
-rw-r--r--src/nix/profile.md2
5 files changed, 11 insertions, 11 deletions
diff --git a/mk/cxx-big-literal.mk b/mk/cxx-big-literal.mk
new file mode 100644
index 000000000..85365df8e
--- /dev/null
+++ b/mk/cxx-big-literal.mk
@@ -0,0 +1,5 @@
+%.gen.hh: %
+ @echo 'R"foo(' >> $@.tmp
+ $(trace-gen) cat $< >> $@.tmp
+ @echo ')foo"' >> $@.tmp
+ @mv $@.tmp $@
diff --git a/mk/lib.mk b/mk/lib.mk
index 92f0983d5..34fa624d8 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -101,6 +101,7 @@ include mk/libraries.mk
include mk/programs.mk
include mk/patterns.mk
include mk/templates.mk
+include mk/cxx-big-literal.mk
include mk/tests.mk
diff --git a/src/libstore/local.mk b/src/libstore/local.mk
index e5e24501e..0be0bf310 100644
--- a/src/libstore/local.mk
+++ b/src/libstore/local.mk
@@ -57,12 +57,6 @@ $(d)/local-store.cc: $(d)/schema.sql.gen.hh $(d)/ca-specific-schema.sql.gen.hh
$(d)/build.cc:
-%.gen.hh: %
- @echo 'R"foo(' >> $@.tmp
- $(trace-gen) cat $< >> $@.tmp
- @echo ')foo"' >> $@.tmp
- @mv $@.tmp $@
-
clean-files += $(d)/schema.sql.gen.hh $(d)/ca-specific-schema.sql.gen.hh
$(eval $(call install-file-in, $(d)/nix-store.pc, $(libdir)/pkgconfig, 0644))
diff --git a/src/nix/local.mk b/src/nix/local.mk
index 86d5c4775..20ea29d10 100644
--- a/src/nix/local.mk
+++ b/src/nix/local.mk
@@ -33,8 +33,8 @@ src/nix-channel/nix-channel.cc: src/nix-channel/unpack-channel.nix.gen.hh
src/nix/main.cc: doc/manual/generate-manpage.nix.gen.hh doc/manual/utils.nix.gen.hh
-src/nix/profile.cc: src/nix/profile.md src/nix/doc/files/profiles.md
-
src/nix/doc/files/%.md: doc/manual/src/command-ref/files/%.md
- mkdir -p $$(dirname $@)
- ( printf 'R""(\n'; cat $^; printf '\n)""' ) > $@
+ @mkdir -p $$(dirname $@)
+ @cp $< $@
+
+src/nix/profile.cc: src/nix/profile.md src/nix/doc/files/profiles.md.gen.hh
diff --git a/src/nix/profile.md b/src/nix/profile.md
index c6a266c24..bd13f906f 100644
--- a/src/nix/profile.md
+++ b/src/nix/profile.md
@@ -11,7 +11,7 @@ them to be rolled back easily.
)""
-#include "doc/files/profiles.md"
+#include "doc/files/profiles.md.gen.hh"
R""(