From 2ebe6fcceae1cb851c441823d4965774445bc194 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Mon, 30 Oct 2023 02:33:30 +0300 Subject: [PATCH] Add configure for make --- .gitignore | 1 + Makefile | 2 +- configure | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 configure diff --git a/.gitignore b/.gitignore index 0fd9bb7..1c154dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ obj/ game +config.mk diff --git a/Makefile b/Makefile index e93e1de..0fd3380 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,6 @@ $(OUT): obj $(OBJ) $(CC) -o $@ $(OBJ) $(LDFLAGS) clean: - $(RM) $(OUT) $(OBJDIR)/* + $(RM) $(OUT) config.mk $(OBJDIR)/* .PHONY: default clean diff --git a/configure b/configure new file mode 100755 index 0000000..071c032 --- /dev/null +++ b/configure @@ -0,0 +1,19 @@ +#!/bin/sh + +CC=${CC:-cc} +RM=${RM:-rm -f} +CFLAGS=${CFLAGS:-} +LDFLAGS=${LDFLAGS:-} +OUT=${OUT:-game} + +echo "Compiler: $CC" +echo "Remove: $RM" +echo "CFLAGS: $CFLAGS" +echo "LDFLAGS: $LDFLAGS" +echo "Out file: $OUT" + +echo "CC = $CC +RM = $RM +CFLAGS = $CFLAGS +LDFLAGS = $LDFLAGS +OUT = $OUT" > config.mk