fire/makefile

42 lines
778 B
Makefile
Raw 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 \
-Wold-style-definition -Werror
2019-12-13 03:27:13 +00:00
INC = -Isub/termbox_next/src -Isub/ccommon/
2019-12-12 23:46:24 +00:00
2019-12-12 15:01:43 +00:00
CC = clang
2019-12-12 23:46:24 +00:00
CFLAGS = -g -std=c99 $(WARNING) $(INC)
2019-12-12 15:01:43 +00:00
LDFLAGS = -fuse-ld=lld
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
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)"
2019-12-12 23:53:07 +00:00
@$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
2019-12-12 15:01:43 +00:00
2019-12-13 14:43:38 +00:00
install: $(NAME)
install -m755 ./$(NAME) /usr/bin/$(NAME)
.PHONY: all clean install