src/Makefile

changeset 58
7ba8a97a8b6e
parent 55
54ea19938d57
child 71
0bdb910478cc
equal deleted inserted replaced
57:498d92449d6d 58:7ba8a97a8b6e
34 SRC += input.c 34 SRC += input.c
35 SRC += server.c 35 SRC += server.c
36 SRC += client.c 36 SRC += client.c
37 SRC += game.c 37 SRC += game.c
38 38
39 OBJ = $(SRC:%.c=../build/release/%$(OBJ_EXT)) 39 OBJ = $(SRC:%.c=$(BUILDDIR)/%$(OBJ_EXT))
40 OBJ_D = $(SRC:%.c=../build/debug/%$(OBJ_EXT))
41 40
42 all: ../build/release $(OBJ) 41 all: $(BUILDDIR) $(OBJ)
43 $(LD) -o ../build/release/$(BIN) $(OBJ) \ 42 $(LD) -o $(BUILDDIR)/$(BIN) $(OBJ) \
44 ../build/release/chess$(LIB_EXT) $(LDFLAGS) 43 $(BUILDDIR)/chess$(LIB_EXT) $(LDFLAGS)
45 44
46 debug: ../build/debug $(OBJ_D) 45 $(BUILDDIR)/%$(OBJ_EXT): %.c
47 $(LD) -o ../build/debug/$(BIN) $(OBJ_D) \ 46 $(CC) -o $@ $(CFLAGS) -c $<
48 ../build/debug/chess$(LIB_EXT) $(LDFLAGS) 47
48 $(BUILDDIR):
49 $(MKDIR) $(MKDIRFLAGS) $(BUILDDIR)
49 50
50 ../build/release/%$(OBJ_EXT): %.c
51 $(CC) -o $@ $(CFLAGS) -c $<
52
53 ../build/debug/%$(OBJ_EXT): %.c
54 $(CC) -o $@ $(CFLAGS_D) -c $<
55
56 ../build/release:
57 $(MKDIR) $(MKDIRFLAGS) ../build/release
58
59 ../build/debug:
60 $(MKDIR) $(MKDIRFLAGS) ../build/debug
61

mercurial