Permalink
Browse files

Move new Make macros to Make.inc

Also make use of them in deps/Makefile and allow them to be used with either relative
or abosulte paths
  • Loading branch information...
1 parent baeb10c commit 6ac5993c0b45799201f8cac8cf2d02f19b05b5e4 @Keno Keno committed May 29, 2012
Showing with 18 additions and 15 deletions.
  1. +14 −0 Make.inc
  2. +0 −8 Makefile
  3. +4 −7 deps/Makefile
View
@@ -217,6 +217,20 @@ endif
# Libraries to link
LIBS = $(shell $(LLVM_CONFIG) --libfiles) $(WHOLE_ARCHIVE) $(JULIAHOME)/src/flisp/libflisp.a $(WHOLE_ARCHIVE) $(JULIAHOME)/src/support/libsupport.a -L$(USR)/lib $(USRLIB)/uv.a $(OSLIBS) -lpthread $(shell $(LLVM_CONFIG) --ldflags)
+# Make tricks
+
+define symlink_target
+$$(subst $$(abspath $(JULIAHOME))/,,$$(abspath $(2)/$(1))): $$(abspath $(2)/$(1))
+$$(abspath $(2)/$(1)):
+ @ln -sf $$(abspath $(1)) $$@
+endef
+define dir_target
+$$(subst $$(abspath $(JULIAHOME))/,,$$(abspath $(1))): $$(abspath $(1))
+$$(abspath $(1)):
+ @mkdir -p $$@
+endef
+
+
# Colors for make
CCCOLOR="\033[34m"
View
@@ -6,14 +6,6 @@ default: release
DIRS = usr/bin usr/etc usr/lib/julia
-define symlink_target
-$(2)/$(1):
- @cd $(2) && ln -sf $$(abspath $(1)) .
-endef
-define dir_target
-$(1):
- @mkdir -p $$@
-endef
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,extras base,$(eval $(call symlink_target,$(link),usr/lib)))
View
@@ -106,14 +106,11 @@ distclean: $(addprefix distclean-, $(LIBS))
rm -rf $(USR)
## PATHS ##
-$(USR):
- mkdir -p $(USR)/lib
- mkdir -p $(USR)/include
- mkdir -p $(USR)/bin
- mkdir -p $(USR)/share
- mkdir -p $(USR)/etc
+DIRS = $(addprefix $(USR)/,lib include bin share etc)
+
+$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
-$(USRLIB): $(USR)
+$(USR): $(DIRS)
## LLVM ##

0 comments on commit 6ac5993

Please sign in to comment.