CC= gcc
LDFLAGS= -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib/ncurses -L/usr/local/lib/ncurses
CPPFLAGS= -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses
CFLAGS= -O3 -Wall -std=c99
LIBS= -lncurses
DESTDIR= /usr/local
OFILES= Main.o \
Move.o \
Output.o
all: n2048
install: all
cp n2048 $(DESTDIR)/bin
cp n2048.6 $(DESTDIR)/share/man/man6
n2048: $(OFILES)
$(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
.c.o:
$(CC) $< -c -I. $(CPPFLAGS) $(CFLAGS) $(OPTIONS)
clean:
rm -rf n2048 $(OFILES)
#ifndef CONFIG_H
#define CONFIG_H
#define TILE_ROWS 4
#define TILE_COLS 4
#define TILE_MASK 0xf // the next power of 2 after TILE_ROWS*TILE_COLS, minus 1.
#define TILE_4_PROB 32 // one in 32 tiles might be a 4 instead of a 2.
#define WINNING_TILE 2048 // The highest possible tile
#endif
Makefile && Config
最新推荐文章于 2024-05-12 09:52:41 发布