commit 2467fa19411d70c64dd3bafc465784568964ec5a parent 00af84869fd5c1e894d3dddf21b6e080f77f135c Author: Christos Margiolis <christos@margiolis.net> Date: Wed, 21 Oct 2020 13:41:14 +0300 added config.mk Diffstat:
M | Makefile | | | 28 | +++++----------------------- |
A | config.mk | | | 40 | ++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,34 +1,16 @@ # See LICENSE file for copyright and license details. -# chip8 - a minimal chip8 emulator +# chip8 - a minimal CHIP-8 emulator .POSIX: +include config.mk + BIN = chip8 -VERSION = 0.1 DIST = ${BIN}-${VERSION} -MAN1 = ${BIN}.1 -PREFIX = /usr/local -MAN_DIR = ${PREFIX}/man/man1 -BIN_DIR = ${PREFIX}/bin +#MAN1 = ${BIN}.1 -#EXT = c -#SRC = ${wildcard *.${EXT}} -#OBJ = ${SRC:%.${EXT}=%.o} SRC = chip8.c OBJ = chip8.o -CC = gcc -INCS = -Iinclude -CPPFLAGS = -DVERSION=\"${VERSION}\" -CFLAGS = -Wall -std=c99 -pedantic -O3 ${INCS} ${CPPFLAGS} -LDFLAGS = -Llib -lSDL2 - -CP = cp -f -RM = rm -f -RM_DIR = rm -rf -MKDIR = mkdir -p -TAR = tar -cf -GZIP = gzip - all: options ${BIN} options: @@ -45,7 +27,7 @@ ${OBJ}: ${SRC} dist: clean ${MKDIR} ${DIST} - ${CP} -R roms ${SRC} LICENSE Makefile README.md ${DIST} + ${CP} -R roms ${SRC} config.mk LICENSE Makefile README.md ${DIST} ${TAR} ${DIST}.tar ${DIST} ${GZIP} ${DIST}.tar ${RM_DIR} ${DIST} diff --git a/config.mk b/config.mk @@ -0,0 +1,40 @@ +# See LICENSE file for copyright and license details. +# chip8 version +VERSION = 0 + +# paths +PREFIX = /usr/local +MAN_DIR = ${PREFIX}/man/man1 +BIN_DIR = ${PREFIX}/bin +# uncomment if you're making a library +#MAN_DIR = ${PREFIX}/man/man3 +#INC_DIR = ${PREFIX}/include +#LIB_DIR = ${PREFIX}/lib + +# includes and libs +INCS = -Iinclude +LIBS = -Llib -lSDL2 + +# flags +CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L \ + -DVERSION=\"${VERSION}\" +CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations \ + -O3 ${INCS} ${CPPFLAGS} +LDFLAGS = ${LIBS} +# uncomment if you're making a library +#ARFLAGS = rs + +# utils +CP = cp -f +RM = rm -f +RM_DIR = rm -rf +MV = mv +MKDIR = mkdir -p +RM_DIR = rm -rf +TAR = tar -cf +GZIP = gzip + +# compiler +CC = gcc +# uncomment if you're making a library +#AR = ar