2022-09-18 13:48:23 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
CC = gcc
|
|
|
|
SRC = main.c loop.c exec.c line.c builtin.c
|
|
|
|
OBJ = $(SRC:.c=.ro)
|
|
|
|
DBGOBJ = $(SRC:.c=.do)
|
|
|
|
EXE = dish
|
|
|
|
DBGEXE = ddish
|
2022-09-18 03:15:07 +00:00
|
|
|
|
2022-09-18 13:48:23 +00:00
|
|
|
all:release debug
|
|
|
|
debug: CFLAGS = -g -O0 -DDEBUG
|
|
|
|
release: CFLAGS = -Wall -O3
|
2022-09-18 03:15:07 +00:00
|
|
|
|
2022-09-18 13:48:23 +00:00
|
|
|
release: $(OBJ)
|
|
|
|
$(CC) $(CFLAGS) -o $(EXE) $(OBJ)
|
2022-09-18 03:15:07 +00:00
|
|
|
|
2022-09-18 13:48:23 +00:00
|
|
|
debug: $(DBGOBJ)
|
|
|
|
$(CC) $(CFLAGS) -o $(DBGEXE) $(DBGOBJ)
|
2022-09-18 05:43:33 +00:00
|
|
|
|
2022-09-18 03:15:07 +00:00
|
|
|
clean:
|
2022-09-18 13:48:23 +00:00
|
|
|
rm -f *.o
|
|
|
|
|
|
|
|
$(OBJ):$(SRC)
|
|
|
|
$(CC) $(CFLAGS) -c $(SRC)
|
|
|
|
rename .o .ro *.o
|
2022-09-18 03:15:07 +00:00
|
|
|
|
2022-09-18 13:48:23 +00:00
|
|
|
$(DBGOBJ):$(SRC)
|
|
|
|
$(CC) $(CFLAGS) -c $(SRC)
|
|
|
|
rename .o .do *.o
|
|
|
|
|
|
|
|
c:clean
|
|
|
|
d:debug
|
|
|
|
r:release
|