2016-04-15 11:02:09 -07:00
|
|
|
BIN=bin
|
|
|
|
OBJ=obj
|
|
|
|
SRC=src
|
|
|
|
|
|
|
|
CC = gcc
|
2016-04-27 21:51:47 -07:00
|
|
|
CFLAGS = -Wextra -Wall
|
2016-04-18 08:12:56 -07:00
|
|
|
LDLIBS = -lncurses
|
2016-04-27 22:25:18 -07:00
|
|
|
NCURSES_H = /usr/include/ncurses.h
|
2016-04-15 11:02:09 -07:00
|
|
|
|
2016-04-27 21:51:47 -07:00
|
|
|
all: nms sneakers
|
2016-04-18 09:00:57 -07:00
|
|
|
|
2016-04-27 21:51:47 -07:00
|
|
|
nms: $(OBJ)/nms.o $(OBJ)/main.o | $(BIN)
|
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/$@ $^ $(LDLIBS)
|
2016-04-19 15:18:02 -07:00
|
|
|
|
2016-04-27 21:51:47 -07:00
|
|
|
sneakers: $(OBJ)/nms.o $(OBJ)/sneakers.o | $(BIN)
|
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/$@ $^ $(LDLIBS)
|
2016-04-15 11:02:09 -07:00
|
|
|
|
2016-04-27 22:25:18 -07:00
|
|
|
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ) $(NCURSES_H)
|
2016-04-27 21:51:47 -07:00
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
2016-04-19 15:18:02 -07:00
|
|
|
|
2016-04-27 21:51:47 -07:00
|
|
|
$(BIN):
|
|
|
|
mkdir $(BIN)
|
|
|
|
|
|
|
|
$(OBJ):
|
|
|
|
mkdir $(OBJ)
|
|
|
|
|
|
|
|
$(NCURSES_H):
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install ncurses-dev
|
2016-04-15 11:02:09 -07:00
|
|
|
|
|
|
|
clean:
|
2016-04-27 21:51:47 -07:00
|
|
|
rm -rf $(BIN)
|
|
|
|
rm -rf $(OBJ)
|