forked from nakidai/csnake
1
0
Fork 0

Some work with templates

- Now configure script also reads templates (files which end by .in)
  - So added template for config.mk
- Moved templates to templates/ folder
Nakidai 2024-03-07 00:27:37 +03:00
parent 8c6395592d
commit ad871be017
Signed by: nakidai
GPG Key ID: 18AD605FDA13FE5A
4 changed files with 10 additions and 10 deletions

View File

@ -32,4 +32,7 @@ set(DEFX 0 CACHE STRING "Start x")
set(DEFY 0 CACHE STRING "Start y")
set(SLEEP 1000 CACHE STRING "Sleep between frames (ms)")
configure_file(include/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/config.h)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/templates/config.h.in
${CMAKE_CURRENT_SOURCE_DIR}/include/config.h
)

11
configure vendored
View File

@ -45,12 +45,5 @@ echo "Start x: $DEFX"
echo "Start y: $DEFY"
echo "Sleep: $SLEEP"
echo "CC = $CC
CFLAGS = $CFLAGS
LDFLAGS = $LDFLAGS
OUT = $OUT" > config.mk
echo "#define FIELD_SIZE $FIELD_SIZE
#define DEFX $DEFX
#define DEFY $DEFY
#define SLEEP $SLEEP" > include/config.h
eval "echo \"$(cat templates/config.mk.in)\"" > config.mk
eval "echo \"$(cat templates/config.h.in)\"" > include/config.h

4
templates/config.mk.in Normal file
View File

@ -0,0 +1,4 @@
CC = ${CC}
CFLAGS = ${CFLAGS}
LDFLAGS = ${LDFLAGS}
OUT = ${OUT}