dish/Makefile

37 lines
608 B
Makefile
Raw Permalink Normal View History

2022-09-18 13:48:23 +00:00
SHELL := /bin/bash
CC = gcc
2023-03-29 15:01:10 +00:00
SRC = main.c loop.c exec.c line.c builtin.c postgres.c
LINK= -lreadline -lpq
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
2023-03-30 09:00:42 +00:00
a:all
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
2023-03-30 09:00:42 +00:00
r:release
2022-09-18 13:48:23 +00:00
release: $(OBJ)
$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LINK)
2022-09-18 03:15:07 +00:00
2023-03-30 09:00:42 +00:00
d:debug
2022-09-18 13:48:23 +00:00
debug: $(DBGOBJ)
$(CC) $(CFLAGS) -o $(DBGEXE) $(DBGOBJ) $(LINK)
2022-09-18 05:43:33 +00:00
2023-03-30 09:00:42 +00:00
c: clean
2022-09-18 03:15:07 +00:00
clean:
2023-03-30 09:00:42 +00:00
rm -f *.o *.do *.ro dish ddish
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)
$(CC) $(CFLAGS) -c $(SRC)
2022-09-18 13:48:23 +00:00
rename .o .do *.o
c:clean
d:debug
r:release