fire/makefile

49 lines
1002 B
Makefile
Raw Permalink Normal View History

2019-12-12 15:01:43 +00:00
#
# fire: the pre-cambrian DOOM animation in the terminal
# (c) Kied Llaentenn
# See the LICENSE for more information
#
NAME = fire
WARNING = -Wall -Wextra -pedantic -Wmissing-prototypes \
2020-09-17 11:42:48 +00:00
-Wold-style-definition
2019-12-12 15:01:43 +00:00
2020-03-09 16:29:38 +00:00
INC = -Isub/termbox_next/src
2019-12-12 23:46:24 +00:00
2019-12-13 15:01:20 +00:00
CC = gcc
CFLAGS = -std=c99 $(WARNING) $(INC) -fsanitize=address -Og -ggdb
2019-12-13 21:15:29 +00:00
LDFLAGS =
2019-12-12 15:01:43 +00:00
2019-12-13 02:18:56 +00:00
TRMBOX = sub/termbox_next/bin/termbox.a
2019-12-13 03:27:13 +00:00
SRC = main.c draw.c
OBJ = $(SRC:.c=.o)
2019-12-12 15:01:43 +00:00
2019-12-14 21:25:12 +00:00
DESTDIR = /
PREFIX = /usr/local/
2019-12-12 15:01:43 +00:00
all: $(NAME)
clean:
2019-12-12 23:53:07 +00:00
rm -f $(NAME) $(OBJ)
2019-12-12 15:01:43 +00:00
.c.o:
@echo "\tCC\t\t$@"
2019-12-12 23:53:07 +00:00
@$(CC) $(CFLAGS) -c $<
2019-12-12 15:01:43 +00:00
2019-12-13 02:18:56 +00:00
$(TRMBOX):
@echo "\tCC\t\ttermbox.c"
2019-12-13 03:27:13 +00:00
@cd sub/termbox_next/ && (make >/dev/null)
2019-12-13 02:18:56 +00:00
$(NAME): $(OBJ) $(TRMBOX)
2019-12-12 15:01:43 +00:00
@echo "\tLD\t\t$(NAME)"
2020-03-09 16:35:10 +00:00
@$(CC) -o $(NAME) $(OBJ) $(TRMBOX) $(CFLAGS) $(LDFLAGS)
2019-12-12 15:01:43 +00:00
2019-12-13 14:43:38 +00:00
install: $(NAME)
2019-12-14 21:25:12 +00:00
@echo "\tINSTALL\t\t$(NAME)\t$(DESTDIR)/$(PREFIX)/bin/$(NAME)"
@install -m755 ./$(NAME) $(DESTDIR)/$(PREFIX)/bin/$(NAME)
2019-12-13 14:43:38 +00:00
2019-12-14 21:25:12 +00:00
uninstall:
@echo "\tRM\t\t$(DESTDIR)/$(PREFIX)/bin/$(NAME)"
@rm -f $(DESTDIR)/$(PREFIX)/bin/$(NAME)
2019-12-13 14:43:38 +00:00
.PHONY: all clean install