dish/Makefile

33 lines
564 B
Makefile
Raw 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
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) $(LINK)
2022-09-18 03:15:07 +00:00
2022-09-18 13:48:23 +00:00
debug: $(DBGOBJ)
$(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)
$(CC) $(CFLAGS) -c $(SRC)
2022-09-18 13:48:23 +00:00
rename .o .do *.o
c:clean
d:debug
r:release