@@ -63,7 +63,18 @@ SRCS += anticodegen
63
63
LLVM_LIBS := support
64
64
endif
65
65
66
- HEADERS := $(addprefix $(SRCDIR ) /,julia.h julia_threads.h julia_internal.h options.h timing.h) $(BUILDDIR ) /julia_version.h $(wildcard $(SRCDIR ) /support/* .h) $(LIBUV_INC ) /uv.h
66
+ # headers are used for dependency tracking, while public headers will be part of the dist
67
+ HEADERS := $(BUILDDIR ) /julia_version.h $(wildcard $(SRCDIR ) /support/* .h) $(addprefix $(SRCDIR ) /,julia.h julia_threads.h julia_internal.h options.h timing.h)
68
+ PUBLIC_HEADERS := $(BUILDDIR ) /julia_version.h $(wildcard $(SRCDIR ) /support/* .h) $(addprefix $(SRCDIR ) /,julia.h julia_threads.h)
69
+ ifeq ($(USE_SYSTEM_LIBUV ) ,0)
70
+ ifeq ($(OS ) ,WINNT)
71
+ HEADERS += $(build_includedir ) /tree.h
72
+ PUBLIC_HEADERS += $(build_includedir ) /tree.h
73
+ endif
74
+ HEADERS += $(LIBUV_INC ) /uv.h
75
+ PUBLIC_HEADERS += $(LIBUV_INC ) /uv*
76
+ endif
77
+ PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir ) /julia/,$(notdir $(PUBLIC_HEADERS ) ) )
67
78
68
79
# In LLVM < 3.4, --ldflags includes both options and libraries, so use it both before and after --libs
69
80
# In LLVM >= 3.4, --ldflags has only options, and --system-libs has the libraries.
@@ -123,6 +134,15 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/llvm-version.h $(HEADERS) $(LLVM_CONF
123
134
$(BUILDDIR ) /% .dbg.obj : $(SRCDIR ) /% .cpp $(SRCDIR ) /llvm-version.h $(HEADERS ) $(LLVM_CONFIG_ABSOLUTE ) | $(BUILDDIR )
124
135
@$(call PRINT_CC, $(CXX ) $(shell $(LLVM_CONFIG_HOST ) --cxxflags) $(CPPFLAGS ) $(CXXFLAGS ) $(DEBUGFLAGS ) -c $< -o $@ )
125
136
137
+ # public header rules
138
+ $(eval $(call dir_target,$(build_includedir)/julia))
139
+ define public_header_target
140
+ TARGET = $(build_includedir ) /julia/$(notdir $(1 ) )
141
+ $$(TARGET ) : $(1 ) | $(build_includedir ) /julia
142
+ $(INSTALL_F ) $$^ $(build_includedir ) /julia/
143
+ endef
144
+ $(foreach HEADER,$(PUBLIC_HEADERS),$(eval $(call public_header_target,$(HEADER))))
145
+
126
146
libccalltest : $(build_shlibdir ) /libccalltest.$(SHLIB_EXT )
127
147
128
148
ifeq ($(OS ) , Linux)
@@ -244,7 +264,7 @@ $(BUILDDIR)/libjulia-debug.a: $(SRCDIR)/julia.expmap $(DOBJS) $(BUILDDIR)/flisp/
244
264
rm -f $@
245
265
@$(call PRINT_LINK, ar -rcs $@ $(DOBJS ) )
246
266
247
- libjulia-debug : $(build_shlibdir ) /libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT )
267
+ libjulia-debug : $(build_shlibdir ) /libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT ) $( PUBLIC_HEADER_TARGETS )
248
268
249
269
$(build_shlibdir ) /libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(SRCDIR ) /julia.expmap $(OBJS ) $(BUILDDIR ) /flisp/libflisp.a $(BUILDDIR ) /support/libsupport.a $(LIBUV )
250
270
@$(call PRINT_LINK, $(CXXLD ) $(CXXFLAGS ) $(CXXLDFLAGS ) $(SHIPFLAGS ) $(OBJS ) $(RPATH_LIB ) -o $@ $(LDFLAGS ) $(JLIBLDFLAGS ) $(RELEASE_LIBS ) $(SONAME ) )
@@ -258,7 +278,7 @@ endif
258
278
$(BUILDDIR ) /libjulia.a : julia.expmap $(OBJS ) $(BUILDDIR ) /flisp/libflisp.a $(BUILDDIR ) /support/libsupport.a
259
279
rm -f $@
260
280
@$(call PRINT_LINK, ar -rcs $@ $(OBJS ) )
261
- libjulia-release : $(build_shlibdir ) /libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT )
281
+ libjulia-release : $(build_shlibdir ) /libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT ) $( PUBLIC_HEADER_TARGETS )
262
282
263
283
clean :
264
284
-rm -fr $(build_shlibdir ) /libjulia* $(build_shlibdir ) /libccalltest*
0 commit comments