create compile_commands on make

This commit is contained in:
Chris Cromer 2021-07-28 01:01:19 -04:00
parent 9a4d0362dc
commit 1456fb9bec
3 changed files with 28 additions and 127 deletions

View File

@ -7,16 +7,38 @@ OBJ=$(SRC:.c=.o)
all: shell doc report
shell: $(OBJ)
shell:
ifneq (, $(shell which bear))
ifeq (, $(wildcard ./compile_commands.json))
$(MAKE) shellbear
else
$(MAKE) shellbuild
endif
else
$(MAKE) shellbuild
endif
shellbear:
bear make shellbuild
shellbuild: $(OBJ)
$(CC) $(CFLAGS) -o $(FILENAME) $^ $(LDFLAGS)
doc:
# if doxygen is install create the code documentation
# if doxygen and bear are installed create the code documentation
ifneq (, $(shell which bear))
ifeq (, $(wildcard ./compile_commands.json))
$(MAKE) cleanshell
$(MAKE) shellbear
endif
ifneq (, $(shell which doxygen))
doxygen doxygen.conf
make -C docs/latex
mv docs/latex/refman.pdf refman.pdf
endif
endif
report:
# if pdflatex is installed create the report
@ -31,13 +53,13 @@ endif
clean: cleanshell cleandoc cleanreport
cleanshell:
rm -f src/*.o $(FILENAME)
rm -f src/*.o $(FILENAME) compile_commands.json
cleandoc:
rm -rf refman.pdf docs
rm -rf refman.pdf docs compile_commands.json
cleanreport:
make -C report clean
rm -f Informe.pdf
.PHONY: all shell doc report clean cleanshell cleandoc cleanreport
.PHONY: all shell shellbear shellbuild doc report clean cleanshell cleandoc cleanreport

View File

@ -15,6 +15,7 @@ myshellin es un proyecto semestral del ramo Sistemas Operativos. El propósito d
## Requisitos documentacón
- doxygen
- bear
## Compilar

View File

@ -1,122 +0,0 @@
[
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/utils.o",
"src/utils.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/utils.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/loop.o",
"src/loop.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/loop.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/array.o",
"src/array.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/array.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/builtins.o",
"src/builtins.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/builtins.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/launch.o",
"src/launch.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/launch.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/myshellin.o",
"src/myshellin.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/myshellin.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/console_line.o",
"src/console_line.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/console_line.c"
},
{
"arguments": [
"clang",
"-c",
"-Wall",
"-Isrc/include",
"-g",
"-std=c11",
"-o",
"src/redirect.o",
"src/redirect.c"
],
"directory": "/mnt/data/projects/myshellin",
"file": "src/redirect.c"
}
]