forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (19 loc) · 993 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
JULIAHOME = ..
include ../Make.inc
PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+
all: pcre_h.jl errno_h.jl build_h.jl file_constants.jl
pcre_h.jl:
$(QUIET_PERL) $(CC) -E -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+PCRE_(\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@
errno_h.jl:
$(QUIET_PERL) echo '#include "errno.h"' | $(CC) -E -dM - | perl -nle 'print "const $$1 = int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | sort > $@
file_constants.jl: ../src/file_constants.h
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/file_constants.h | perl -nle 'print "$$1" if /^(\s*const\s+[A-z_]+\s+=\s+[0-9A-z_]+\s*)$$/' > $@
build_h.jl: ../Make.inc ../src/os_detect.h
$(QUIET_PERL) $(CC) -E -P -DJULIA ../src/os_detect.h | grep OS_NAME > $@
@echo "const libblas_name = \"$(LIBBLASNAME)\"" >> $@
@echo "const liblapack_name = \"$(LIBLAPACKNAME)\"" >> $@
clean:
rm -f *# *~
rm -f pcre_h.jl
rm -f errno_h.jl
rm -f build_h.jl