37 SRC += bishop.c |
37 SRC += bishop.c |
38 SRC += queen.c |
38 SRC += queen.c |
39 SRC += king.c |
39 SRC += king.c |
40 SRC += rules.c |
40 SRC += rules.c |
41 |
41 |
42 OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT)) |
42 OBJ = $(SRC:%.c=$(BUILDDIR)/release/%$(OBJ_EXT)) |
|
43 OBJ_D = $(SRC:%.c=$(BUILDDIR)/debug/%$(OBJ_EXT)) |
43 |
44 |
44 all: $(OBJ) |
45 all: $(OBJ) |
45 $(AR) $(ARFLAGS) $(BUILDDIR)/chess$(LIB_EXT) $(OBJ) |
46 $(AR) $(ARFLAGS) $(BUILDDIR)/release/chess$(LIB_EXT) $(OBJ) |
|
47 |
|
48 debug: $(OBJ_D) |
|
49 $(AR) $(ARFLAGS) $(BUILDDIR)/debug/chess$(LIB_EXT) $(OBJ_D) |
|
50 |
|
51 $(BUILDDIR)/release/%$(OBJ_EXT): %.c $(BUILDDIR)/release |
|
52 $(CC) -o $@ $(CFLAGS) -c $< |
46 |
53 |
47 |
54 $(BUILDDIR)/debug/%$(OBJ_EXT): %.c $(BUILDDIR)/debug |
48 $(BUILDDIR)/%$(OBJ_EXT): %.c |
55 $(CC) -o $@ $(CFLAGS_D) -c $< |
49 $(CC) -o $@ $(CFLAGS) -c $< |
|
50 |
56 |
51 $(BUILDDIR): |
57 $(BUILDDIR): |
52 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR) |
58 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR) |
53 |
59 |
54 clear: |
60 clear: |
55 $(RM) $(RMFLAGS) $(BUILDDIR) |
61 $(RM) $(RMFLAGS) $(BUILDDIR) |
|
62 |
|
63 $(BUILDDIR)/release: |
|
64 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR)/release |
|
65 |
|
66 $(BUILDDIR)/debug: |
|
67 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR)/debug |