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 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) $(CC) $(CFLAGS) -o $(FILENAME) $^ $(LDFLAGS)
doc: 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)) ifneq (, $(shell which doxygen))
doxygen doxygen.conf doxygen doxygen.conf
make -C docs/latex make -C docs/latex
mv docs/latex/refman.pdf refman.pdf mv docs/latex/refman.pdf refman.pdf
endif endif
endif
report: report:
# if pdflatex is installed create the report # if pdflatex is installed create the report
@ -31,13 +53,13 @@ endif
clean: cleanshell cleandoc cleanreport clean: cleanshell cleandoc cleanreport
cleanshell: cleanshell:
rm -f src/*.o $(FILENAME) rm -f src/*.o $(FILENAME) compile_commands.json
cleandoc: cleandoc:
rm -rf refman.pdf docs rm -rf refman.pdf docs compile_commands.json
cleanreport: cleanreport:
make -C report clean make -C report clean
rm -f Informe.pdf 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 ## Requisitos documentacón
- doxygen - doxygen
- bear
## Compilar ## 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"
}
]