diff --git a/Makefile b/Makefile index a5027d0..dfefabb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 5e73a05..39a1386 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ myshellin es un proyecto semestral del ramo Sistemas Operativos. El propósito d ## Requisitos documentacón - doxygen +- bear ## Compilar diff --git a/compile_commands.json b/compile_commands.json deleted file mode 100644 index 92e8680..0000000 --- a/compile_commands.json +++ /dev/null @@ -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" - } -] \ No newline at end of file