diff options
| author | Albert Cervin <albert@acervin.com> | 2024-03-05 09:02:45 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-03-05 09:02:45 +0100 |
| commit | f266c624ad197ea6add738df70702dcbf93cb198 (patch) | |
| tree | a8c2ce9a04ecef065530847108b78ae579b62c0a /Makefile | |
| parent | 678104121a1aeca7851b91bc536de5548efdf651 (diff) | |
| download | dged-f266c624ad197ea6add738df70702dcbf93cb198.tar.gz dged-f266c624ad197ea6add738df70702dcbf93cb198.tar.xz dged-f266c624ad197ea6add738df70702dcbf93cb198.zip | |
Make syntax path a proper search path
Can be set with the $TREESITTER_GRAMMARS variable, separated by ':'
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -69,7 +69,17 @@ FILES = $(DEPS) $(MAIN_OBJS) $(OBJS) dged libdged.a $(TEST_OBJS) $(PLATFORM_OBJS @mkdir -p $(@D) $(CC) $(CFLAGS) -c $< -o $@ -dged: $(MAIN_OBJS) libdged.a +grammars: + if [ -n "$$TREESITTER_GRAMMARS" ]; then \ + IFS=":"; for p in "$$TREESITTER_GRAMMARS"; do \ + cp -rL "$$p"/ grammars; \ + done \ + else \ + @echo "TODO: download and build default set of grammars"; \ + mkdir -p ./grammars; \ + fi + +dged: $(MAIN_OBJS) libdged.a grammars $(CC) $(LDFLAGS) $(MAIN_OBJS) libdged.a -o dged -lm libdged.a: $(OBJS) $(PLATFORM_OBJS) @@ -104,15 +114,13 @@ install: dged install -d $(prefix)/share/man/man1 install -m 644 $(.CURDIR)/dged.1 $(prefix)/share/man/man1/dged.1 - if [ -n "$$TREESITTER_GRAMMARS" ]; then\ - install -d "$(datadir)";\ - cp -rL "$$TREESITTER_GRAMMARS"/ "$(datadir)/grammars";\ - fi + + install -d $(datadir)/grammars + cp -rL $(.OBJDIR)/grammars "$(datadir)/" docs: doxygen $(.CURDIR)/Doxyfile -# in this case we need a separate depend target depend: $(DEPS) @: |
