myshellin/Makefile

33 lines
686 B
Makefile
Raw Normal View History

2021-06-19 17:54:33 -04:00
CC=clang
2021-07-22 22:25:13 -04:00
CFLAGS=-Wall -Isrc/include -std=c11
2021-06-19 19:13:53 -04:00
LDFLAGS=
FILENAME=myshellin
2021-07-20 19:24:22 -04:00
SRC=src/myshellin.c src/loop.c src/console_line.c src/array.c src/builtins.c src/launch.c src/utils.c src/redirect.c
2021-06-19 17:54:33 -04:00
OBJ=$(SRC:.c=.o)
2021-07-23 13:53:49 -04:00
all: shell report
2021-06-19 17:54:33 -04:00
2021-07-23 11:56:15 -04:00
shell: $(OBJ)
2021-06-19 19:13:53 -04:00
$(CC) $(CFLAGS) -o $(FILENAME) $^ $(LDFLAGS)
2021-06-19 17:54:33 -04:00
2021-07-23 11:56:15 -04:00
report:
# if pdflatex is installed create the report
2021-06-19 17:54:33 -04:00
ifneq (, $(shell which pdflatex))
make -C doc
mv doc/Informe.pdf Informe.pdf
else ifneq (, $(shell which pdftex))
make -C doc
mv doc/Informe.pdf Informe.pdf
2021-06-19 17:54:33 -04:00
endif
2021-07-23 12:14:58 -04:00
clean: cleanshell cleanreport
2021-06-19 17:54:33 -04:00
2021-07-23 11:56:15 -04:00
cleanshell:
2021-06-19 20:59:34 -04:00
rm -f src/*.o $(FILENAME)
2021-06-19 17:54:33 -04:00
2021-07-23 11:56:15 -04:00
cleanreport:
2021-06-19 17:54:33 -04:00
make -C doc clean
rm -f Informe.pdf
2021-07-23 11:56:15 -04:00
.PHONY: all shell report clean cleanshell cleanreport