diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-05-02 21:04:36 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2024-05-02 21:37:17 +0100 |
commit | 476044b4947632ba2b03bc368a513cba55cb1103 (patch) | |
tree | 6245b04828f77820d8ce59c1b50ed6e16de7d8fc | |
parent | 38f90d7bd6669bd6f48be178669a6186e40b30de (diff) |
Makefile: Add support for generating compile_flags.txt
This helps tools like clangd understand where the header files are such
that they can be used to navigate the codebase quickly and easily.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | include/stem.h | 2 |
3 files changed, 5 insertions, 1 deletions
@@ -9,3 +9,4 @@ tmp/ /latex/** stem compile_commands.json +compile_flags.txt @@ -18,6 +18,9 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT) Makefile @mkdir -p $(BUILDDIR) @echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $< -save-temps -O3 +compile_flags.txt: Makefile + printf "%s\n" $(CFLAGS) $(INC) >$@ + clean: @echo " Cleaning..."; @echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET) diff --git a/include/stem.h b/include/stem.h index f4aff54..06f7351 100644 --- a/include/stem.h +++ b/include/stem.h @@ -55,7 +55,7 @@ typedef struct PARSER_STRUCT { /*! @brief Index of current character */ int i; /*! @brief The current character */ - char c; + int c; } parser_t; /*! @brief This structure is to be used in singly linked lists that hold |