2022-09-18 13:48:23 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
CC = gcc
|
|
|
|
SRC = main.c loop.c exec.c line.c builtin.c
|
2022-09-20 13:04:55 +00:00
|
|
|
LINK= -lreadline
|
2022-09-18 13:48:23 +00:00
|
|
|
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)
|
2022-09-20 13:04:55 +00:00
|
|
|
$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LINK)
|
2022-09-18 03:15:07 +00:00
|
|
|
|
2022-09-18 13:48:23 +00:00
|
|
|
debug: $(DBGOBJ)
|
2022-09-20 13:04:55 +00:00
|
|
|
$(CC) $(CFLAGS) -o $(DBGEXE) $(DBGOBJ) $(LINK)
|
2022-09-18 05:43:33 +00:00
|
|
|
|
2022-09-18 03:15:07 +00:00
|
|
|
clean:
|
2022-09-18 14:20:24 +00:00
|
|
|
rm -f *.o *.do *.ro
|
2022-09-18 13:48:23 +00:00
|
|
|
|
|
|
|
$(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)
|
2022-09-20 13:04:55 +00:00
|
|
|
$(CC) $(CFLAGS) -c $(SRC)
|
2022-09-18 13:48:23 +00:00
|
|
|
rename .o .do *.o
|
|
|
|
|
|
|
|
c:clean
|
|
|
|
d:debug
|
|
|
|
r:release
|