27 # |
27 # |
28 |
28 |
29 include ../config.mk |
29 include ../config.mk |
30 |
30 |
31 SRC = main.c colors.c network.c input.c server.c client.c game.c |
31 SRC = main.c colors.c network.c input.c server.c client.c game.c |
32 |
32 OBJ = $(SRC:%.c=$(BUILDDIR)/%.o) |
33 OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT)) |
|
34 |
33 |
35 all: $(BUILDDIR)/terminal-chess FORCE |
34 all: $(BUILDDIR)/terminal-chess FORCE |
36 @echo "Build complete." |
|
37 |
35 |
38 $(BUILDDIR)/terminal-chess: $(OBJ) $(BUILDDIR)/libchess$(LIB_EXT) |
36 $(BUILDDIR)/terminal-chess: $(OBJ) $(BUILDDIR)/libchess$(LIB_EXT) |
39 $(CC) -o $@ $(LDFLAGS) $^ |
37 $(CC) -o $@ $(LDFLAGS) $^ |
40 |
38 |
41 $(BUILDDIR)/libchess$(LIB_EXT): FORCE |
39 $(BUILDDIR)/libchess$(LIB_EXT): FORCE |
42 cd chess; $(MAKE) |
40 cd chess; $(MAKE) |
43 |
41 |
44 $(BUILDDIR)/%$(OBJ_EXT): %.c |
42 FORCE: |
|
43 |
|
44 |
|
45 $(BUILDDIR)/client.o: client.c terminal-chess.h network.h chess/rules.h \ |
|
46 input.h game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \ |
|
47 chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h |
45 $(CC) -o $@ $(CFLAGS) -c $< |
48 $(CC) -o $@ $(CFLAGS) -c $< |
46 |
49 |
47 FORCE: |
50 $(BUILDDIR)/colors.o: colors.c colors.h |
|
51 $(CC) -o $@ $(CFLAGS) -c $< |
|
52 |
|
53 $(BUILDDIR)/game.o: game.c game.h chess/chess.h chess/rules.h \ |
|
54 chess/pawn.h chess/rook.h chess/knight.h chess/bishop.h chess/queen.h \ |
|
55 chess/king.h chess/pgn.h terminal-chess.h network.h chess/rules.h \ |
|
56 input.h colors.h |
|
57 $(CC) -o $@ $(CFLAGS) -c $< |
|
58 |
|
59 $(BUILDDIR)/input.o: input.c input.h |
|
60 $(CC) -o $@ $(CFLAGS) -c $< |
|
61 |
|
62 $(BUILDDIR)/main.o: main.c terminal-chess.h network.h chess/rules.h \ |
|
63 game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \ |
|
64 chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h \ |
|
65 input.h colors.h |
|
66 $(CC) -o $@ $(CFLAGS) -c $< |
|
67 |
|
68 $(BUILDDIR)/network.o: network.c network.h |
|
69 $(CC) -o $@ $(CFLAGS) -c $< |
|
70 |
|
71 $(BUILDDIR)/server.o: server.c terminal-chess.h network.h chess/rules.h \ |
|
72 game.h chess/chess.h chess/rules.h chess/pawn.h chess/rook.h \ |
|
73 chess/knight.h chess/bishop.h chess/queen.h chess/king.h chess/pgn.h |
|
74 $(CC) -o $@ $(CFLAGS) -c $< |
|
75 |