Commit 961a493a authored by houkime's avatar houkime

dirs: better arithmetics and shorter code

parent 4e655bd3
...@@ -4,20 +4,6 @@ comma := , ...@@ -4,20 +4,6 @@ comma := ,
empty := empty :=
space := $(empty) $(empty) space := $(empty) $(empty)
pred_13 := 12
pred_12 := 11
pred_11 := 10
pred_10 := 9
pred_9 := 8
pred_8 := 7
pred_7 := 6
pred_6 := 5
pred_5 := 4
pred_4 := 3
pred_3 := 2
pred_2 := 1
pred_1 := 0
cwd_dirs := $(subst /,$(space),$(PWD)) cwd_dirs := $(subst /,$(space),$(PWD))
#cwd_dirs := $(subst .hw_,hw_,$(cwd_dirs)) #cwd_dirs := $(subst .hw_,hw_,$(cwd_dirs))
#cwd_dirs := $(subst .os_,os_,$(cwd_dirs)) #cwd_dirs := $(subst .os_,os_,$(cwd_dirs))
...@@ -30,7 +16,7 @@ word := $(words $(cwd_dirs)) ...@@ -30,7 +16,7 @@ word := $(words $(cwd_dirs))
#prev := pred_ $(word) #prev := pred_ $(word)
#pred := $(subst $(space),$(empty),$(prev)) #pred := $(subst $(space),$(empty),$(prev))
#word := $($(pred)) #word := $(shell expr $(word) - 1)
#os_name := $(word $(word), $(cwd_dirs)) #os_name := $(word $(word), $(cwd_dirs))
#ifneq ($(findstring os,$(os_name)),os) #ifneq ($(findstring os,$(os_name)),os)
#include ___error___os #include ___error___os
...@@ -38,23 +24,17 @@ word := $(words $(cwd_dirs)) ...@@ -38,23 +24,17 @@ word := $(words $(cwd_dirs))
#prev := pred_ $(word) #prev := pred_ $(word)
#pred := $(subst $(space),$(empty),$(prev)) #pred := $(subst $(space),$(empty),$(prev))
#word := $($(pred)) #word := $(shell expr $(word) - 1)
src_name := $(word $(word), $(cwd_dirs)) src_name := $(word $(word), $(cwd_dirs))
#ifneq ($(src_name),src) #ifneq ($(src_name),src)
#include ___error___no_source_subdirectory #include ___error___no_source_subdirectory
#endif #endif
prev := pred_ $(word) word := $(shell expr $(word) - 1)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
comp_name := $(word $(word), $(cwd_dirs)) comp_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word) word := $(shell expr $(word) - 1)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
type_name := $(word $(word), $(cwd_dirs)) type_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word) word := $(shell expr $(word) - 1)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
root_name := $(word $(word), $(cwd_dirs)) root_name := $(word $(word), $(cwd_dirs))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment