src/Makefile

changeset 71
0bdb910478cc
parent 58
7ba8a97a8b6e
child 72
7e58e0f74e50
--- a/src/Makefile	Tue Aug 13 00:33:59 2019 +0200
+++ b/src/Makefile	Sun Oct 01 12:53:35 2023 +0200
@@ -26,25 +26,22 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-include ../conf.mk
+include ../config.mk
 
-SRC  = main.c
-SRC += colors.c
-SRC += network.c
-SRC += input.c
-SRC += server.c
-SRC += client.c
-SRC += game.c
+SRC  = main.c colors.c network.c input.c server.c client.c game.c
 
 OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT))
 
-all: $(BUILDDIR) $(OBJ)
-	$(LD) -o $(BUILDDIR)/$(BIN) $(OBJ) \
-	$(BUILDDIR)/chess$(LIB_EXT) $(LDFLAGS)
+all: $(BUILDDIR)/terminal-chess FORCE
+	@echo "Build complete."
+
+$(BUILDDIR)/terminal-chess: $(OBJ) $(BUILDDIR)/libchess$(LIB_EXT)
+	$(CC) -o $@ $(LDFLAGS) $^
+
+$(BUILDDIR)/libchess$(LIB_EXT): FORCE
+	cd chess; $(MAKE)
 
 $(BUILDDIR)/%$(OBJ_EXT): %.c
 	$(CC) -o $@ $(CFLAGS) -c $<
-	
-$(BUILDDIR):
-	$(MKDIR) $(MKDIRFLAGS) $(BUILDDIR)
 
+FORCE:

mercurial