am_sysinfo: Create and remove Debug and Release directory
[apps/am_sysinfo.git] / mem_util / makefile
index fee09c1439e17ad10d1da58b017e78a28557ed31..48bdd38b8a688f3e24402c0410368e1650ded889 100644 (file)
@@ -98,6 +98,7 @@ $(BINDIR_D)/$(BIN): $(OBJS_D)
        $(CC) -o $@ $(OBJS_D) $(LIBS_D) $(LDFLAGS)  -Wl,-Map,$(BINDIR_D)/$(NAME).map
 
 $(OBJDIR_D)/%.o : %.c $(HDRS)
+       @mkdir -p $(OBJDIR_D)
        $(CC) $(ALL_DEBUG) $(DEFS) $(ALL_CFLAGS) -o$@ $<
 
 #   ----------------------------------------------------------------------------
@@ -112,10 +113,11 @@ $(BINDIR_R)/$(BIN): $(OBJS_R)
 
 
 $(OBJDIR_R)/%.o : %.c $(HDRS)
+       @mkdir -p $(OBJDIR_R)
        $(CC) $(DEFS) $(ALL_RELEASE) $(ALL_CFLAGS) -o$@ $<
 
 .PHONY: clean
 clean:
-       @rm -f $(OBJDIR_D)/*
-       @rm -f $(OBJDIR_R)/*
+       @rm -rf $(OBJDIR_D)
+       @rm -rf $(OBJDIR_R)