diff -r ed440bcd9740 -r 8a0b85303ee8 src/Makefile --- a/src/Makefile Tue Apr 08 21:13:28 2014 +0200 +++ b/src/Makefile Wed Apr 09 09:34:07 2014 +0200 @@ -35,12 +35,26 @@ SRC += client.c SRC += game.c -OBJ = $(SRC:%.c=../build/%$(OBJ_EXT)) +OBJ = $(SRC:%.c=../build/release/%$(OBJ_EXT)) +OBJ_D = $(SRC:%.c=../build/debug/%$(OBJ_EXT)) all: $(OBJ) - $(LD) -o ../build/$(BIN) $^ ../build/chess$(LIB_EXT) $(LDFLAGS) - + $(LD) -o ../build/release/$(BIN) $^ \ + ../build/release/chess$(LIB_EXT) $(LDFLAGS) -../build/%$(OBJ_EXT): %.c +debug: $(OBJ_D) + $(LD) -o ../build/debug/$(BIN) $^ \ + ../build/debug/chess$(LIB_EXT) $(LDFLAGS) + +../build/release/%$(OBJ_EXT): %.c ../build/release $(CC) -o $@ $(CFLAGS) -c $< +../build/debug/%$(OBJ_EXT): %.c ../build/debug + $(CC) -o $@ $(CFLAGS_D) -c $< + +../build/release: + $(MKDIR) $(MKDIRFLAGS) ../build/release + +../build/debug: + $(MKDIR) $(MKDIRFLAGS) ../build/debug +