aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-18 21:41:08 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit04ec088dfcbdf577987fe7ef93624d67e6d9c2e3 (patch)
tree5f43345251524a5c5a4f43bddb5ff08553d76e1b
parentffecb8f5ae15d6713cc1bad470608ecd205a90f3 (diff)
Multiplatform builds!
-rw-r--r--Makefile20
-rw-r--r--src/ctaklm.c13
2 files changed, 19 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 39d2b10..6e2bece 100644
--- a/Makefile
+++ b/Makefile
@@ -11,24 +11,32 @@ STAT=pptdb
BUILDROOT_DIR=buildroot-2020.11.1
-STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip
-SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size
-CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc
+ifeq ($(PLATFORM), pi)
+ STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip
+ SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size
+ CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc
+else
+ SIZE=size
+ STRIP=strip
+endif
%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)
+all: $(PROG) $(STAT)
+
$(PROG): src/$(PROG).o $(OBJS)
$(CC) $(CFLAGS) src/$(PROG).o $(OBJS) -o $(PROG)
$(STRIP) $(PROG)
$(SIZE) $(PROG)
+ifeq ($(PLATFORM), pi)
+ $(info Building the pi image)
+ ./do_buildroot.sh $(BUILDROOT_DIR)
+endif
$(STAT): src/$(STAT).o $(OBJS)
$(CC) $(CFLAGS) src/$(STAT).o $(OBJS) -o $(STAT)
-buildroot: $(PROG)
- ./do_buildroot.sh $(BUILDROOT_DIR)
-
clean:
rm -f $(PROG)
rm -f $(STAT)
diff --git a/src/ctaklm.c b/src/ctaklm.c
index ff5b8b0..f1bb7cd 100644
--- a/src/ctaklm.c
+++ b/src/ctaklm.c
@@ -146,12 +146,9 @@ print_info(void) {
(ply & 1) ? "Black" : "White",
rst,
(ply < 2) ? " (counter-play start)" : "");
- printf("Flats remaining: %s%02d%s, %s%02d%s\n",
- wht,white_count & 127,rst,
- blk,black_count & 127,rst);
- printf("Caps remaining: %s%d%s, %s%d%s\n",
- wht,white_count >> 7,rst,
- blk,black_count >> 7,rst);
+ printf("Flats/Caps remaining: %s%02d/%d%s, %s%02d/%d%s\n",
+ wht, white_count & 127, white_count >> 7, rst,
+ blk, black_count & 127, black_count >> 7, rst);
}
static char *gamelog = 0;
@@ -314,12 +311,12 @@ ct1986_turn(const uint8_t search_depth) {
// Prepare progress bar
fputs("Computing [", stdout);
for (int k = 0; k < board_size * board_size; k++) putchar(' ');
- fputs("]\033[26D",stdout);
+ fputs("] \033[s\033[27D",stdout);
fflush(stdout);
// Run the minimax
sum_depth = 0; num_check = 0;
float minimax = ct1986_generate(search_depth);
- puts("]\033[1C");
+ fputs("\033[u", stdout);
// Failed to find a move?
if ((minimax <= -infty && (ply & 1) == 1)
||(minimax >= infty && (ply & 1) == 0)) {