src/Makefile

changeset 34
c4d4b8a8f902
parent 32
8a0b85303ee8
child 35
6c64b7a073af
equal deleted inserted replaced
33:866025982aa9 34:c4d4b8a8f902
36 SRC += game.c 36 SRC += game.c
37 37
38 OBJ = $(SRC:%.c=../build/release/%$(OBJ_EXT)) 38 OBJ = $(SRC:%.c=../build/release/%$(OBJ_EXT))
39 OBJ_D = $(SRC:%.c=../build/debug/%$(OBJ_EXT)) 39 OBJ_D = $(SRC:%.c=../build/debug/%$(OBJ_EXT))
40 40
41 all: $(OBJ) 41 all: ../build/release $(OBJ)
42 $(LD) -o ../build/release/$(BIN) $^ \ 42 $(LD) -o ../build/release/$(BIN) $(OBJ) \
43 ../build/release/chess$(LIB_EXT) $(LDFLAGS) 43 ../build/release/chess$(LIB_EXT) $(LDFLAGS)
44 44
45 debug: $(OBJ_D) 45 debug: ../build/debug $(OBJ_D)
46 $(LD) -o ../build/debug/$(BIN) $^ \ 46 $(LD) -o ../build/debug/$(BIN) $(OBJ_D) \
47 ../build/debug/chess$(LIB_EXT) $(LDFLAGS) 47 ../build/debug/chess$(LIB_EXT) $(LDFLAGS)
48 48
49 ../build/release/%$(OBJ_EXT): %.c ../build/release 49 ../build/release/%$(OBJ_EXT): %.c
50 $(CC) -o $@ $(CFLAGS) -c $< 50 $(CC) -o $@ $(CFLAGS) -c $<
51 51
52 ../build/debug/%$(OBJ_EXT): %.c ../build/debug 52 ../build/debug/%$(OBJ_EXT): %.c
53 $(CC) -o $@ $(CFLAGS_D) -c $< 53 $(CC) -o $@ $(CFLAGS_D) -c $<
54 54
55 ../build/release: 55 ../build/release:
56 $(MKDIR) $(MKDIRFLAGS) ../build/release 56 $(MKDIR) $(MKDIRFLAGS) ../build/release
57 57

mercurial