-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
31 lines (21 loc) · 615 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
RELEASE_DIR := Release
DEBUG_DIR := Debug
MKDIR := mkdir
REMOVE := rm
MAKE := make
COPY := cp
define check_dir
if [ ! -d $(1) ]; then $(MKDIR) $(1); cp Makefile.$(2) $(1)/Makefile; $(COPY) *.c *.S *.h $(1) ; fi
endef
all: debug release
debug:
$(call check_dir,$(DEBUG_DIR),debug)
@cd $(DEBUG_DIR); $(MAKE)
release:
$(call check_dir,$(RELEASE_DIR),release)
@cd $(RELEASE_DIR); $(MAKE)
clean:
@if [ -d $(RELEASE_DIR) ]; then cd $(RELEASE_DIR); $(MAKE) clean ; fi
@$(REMOVE) -rf $(RELEASE_DIR)
@if [ -d $(DEBUG_DIR) ]; then cd $(DEBUG_DIR); $(MAKE) clean ; fi
@$(REMOVE) -rf $(DEBUG_DIR)