3

From How to specify additional files as prerequisites that would cause ASDF to recompile the program, I learned that the ASDF static-file directive can be used to list non-Lisp files that a Common Lisp program depends on. For example:

(defsystem "myprog"
  :components ((:static-file "1.txt")
               (:static-file "2.txt")
               (:file "myprog" :depends-on ("1.txt" "2.txt"))))

This requires the programmer to explicitly list out the static files. If there are many static files, and all of them reside in a directory and its sub-directories, it may become impractical to list out all the static files by hand. Is there a way for ASDF to consider all the files in a directory and its sub-directories as static files?

Flux
  • 9,805
  • 5
  • 46
  • 92
  • What I'd do is write a macro which builds the list of static files at macro-expansion time based on the name of the ASDF file. That does it too early really however. A better approach would probably be to define a special static-file module class and use that but doing that requires knowing ASDF better than I care to. – ignis volens May 16 '22 at 14:38

1 Answers1

0

In fact, you can just use the same :static-file "directive" to indicate a dependency on the files in some directory. Or rather the presence of the directory itself (possibly, with some files in it). Theoretically, you could add a separate :static-dir dependency class with some special processing. But the question is what will this special processing constitute? If you don't want to manually specify an exact list of files (which can already be done with (:module "dir" :components ((:static-file "file1") ...))) what other additional processing do you want for this dependency class?

Vsevolod Dyomkin
  • 9,343
  • 2
  • 31
  • 36