src/Makefile

changeset 72
7e58e0f74e50
parent 71
0bdb910478cc
     1.1 --- a/src/Makefile	Sun Oct 01 12:53:35 2023 +0200
     1.2 +++ b/src/Makefile	Sun Oct 01 13:56:42 2023 +0200
     1.3 @@ -29,11 +29,9 @@
     1.4  include ../config.mk
     1.5  
     1.6  SRC  = main.c colors.c network.c input.c server.c client.c game.c
     1.7 -
     1.8 -OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT))
     1.9 +OBJ = $(SRC:%.c=$(BUILDDIR)/%.o)
    1.10  
    1.11  all: $(BUILDDIR)/terminal-chess FORCE
    1.12 -	@echo "Build complete."
    1.13  
    1.14  $(BUILDDIR)/terminal-chess: $(OBJ) $(BUILDDIR)/libchess$(LIB_EXT)
    1.15  	$(CC) -o $@ $(LDFLAGS) $^
    1.16 @@ -41,7 +39,37 @@
    1.17  $(BUILDDIR)/libchess$(LIB_EXT): FORCE
    1.18  	cd chess; $(MAKE)
    1.19  
    1.20 -$(BUILDDIR)/%$(OBJ_EXT): %.c
    1.21 +FORCE:
    1.22 +
    1.23 +
    1.24 +$(BUILDDIR)/client.o: client.c terminal-chess.h network.h chess/rules.h \
    1.25 + input.h game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \
    1.26 + chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h
    1.27  	$(CC) -o $@ $(CFLAGS) -c $<
    1.28  
    1.29 -FORCE:
    1.30 +$(BUILDDIR)/colors.o: colors.c colors.h
    1.31 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.32 +
    1.33 +$(BUILDDIR)/game.o: game.c game.h chess/chess.h chess/rules.h \
    1.34 + chess/pawn.h chess/rook.h chess/knight.h chess/bishop.h chess/queen.h \
    1.35 + chess/king.h chess/pgn.h terminal-chess.h network.h chess/rules.h \
    1.36 + input.h colors.h
    1.37 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.38 +
    1.39 +$(BUILDDIR)/input.o: input.c input.h
    1.40 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.41 +
    1.42 +$(BUILDDIR)/main.o: main.c terminal-chess.h network.h chess/rules.h \
    1.43 + game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \
    1.44 + chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h \
    1.45 + input.h colors.h
    1.46 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.47 +
    1.48 +$(BUILDDIR)/network.o: network.c network.h
    1.49 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.50 +
    1.51 +$(BUILDDIR)/server.o: server.c terminal-chess.h network.h chess/rules.h \
    1.52 + game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \
    1.53 + chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h
    1.54 +	$(CC) -o $@ $(CFLAGS) -c $<
    1.55 +

mercurial