26 # POSSIBILITY OF SUCH DAMAGE. |
26 # POSSIBILITY OF SUCH DAMAGE. |
27 # |
27 # |
28 |
28 |
29 include ../../config.mk |
29 include ../../config.mk |
30 |
30 |
31 SRC = pawn.c rook.c knight.c bishop.c queen.c king.c \ |
31 SRC = pawn.c rook.c knight.c bishop.c queen.c king.c rules.c pgn.c |
32 rules.c pgn.c |
32 OBJ = $(SRC:%.c=$(BUILDDIR)/%.o) |
33 |
33 |
34 OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT)) |
34 all: $(BUILDDIR)/libchess$(LIB_EXT) FORCE |
35 |
35 |
36 all: $(BUILDDIR) $(OBJ) |
36 $(BUILDDIR)/libchess$(LIB_EXT): $(OBJ) |
37 $(AR) $(ARFLAGS) $(BUILDDIR)/libchess$(LIB_EXT) $(OBJ) |
37 $(AR) $(ARFLAGS) $@ $^ |
38 |
38 |
39 $(BUILDDIR)/%$(OBJ_EXT): %.c |
39 FORCE: |
|
40 |
|
41 $(BUILDDIR)/pawn.o: pawn.c pawn.h rules.h |
40 $(CC) -o $@ $(CFLAGS) -c $< |
42 $(CC) -o $@ $(CFLAGS) -c $< |
41 |
43 |
42 $(BUILDDIR): |
44 $(BUILDDIR)/pgn.o: pgn.c pgn.h rules.h |
43 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR) |
45 $(CC) -o $@ $(CFLAGS) -c $< |
44 |
46 |
|
47 $(BUILDDIR)/rules.o: rules.c rules.h chess.h pawn.h rook.h \ |
|
48 knight.h bishop.h queen.h king.h pgn.h |
|
49 $(CC) -o $@ $(CFLAGS) -c $< |
|
50 |
|
51 $(BUILDDIR)/bishop.o: bishop.c bishop.h rules.h |
|
52 $(CC) -o $@ $(CFLAGS) -c $< |
|
53 |
|
54 $(BUILDDIR)/knight.o: knight.c knight.h rules.h |
|
55 $(CC) -o $@ $(CFLAGS) -c $< |
|
56 |
|
57 $(BUILDDIR)/queen.o: queen.c rules.h rook.h bishop.h queen.h |
|
58 $(CC) -o $@ $(CFLAGS) -c $< |
|
59 |
|
60 $(BUILDDIR)/king.o: king.c rules.h king.h |
|
61 $(CC) -o $@ $(CFLAGS) -c $< |
|
62 |
|
63 $(BUILDDIR)/rook.o: rook.c rules.h rook.h |
|
64 $(CC) -o $@ $(CFLAGS) -c $< |