@@ -151,7 +151,9 @@ CEED_LDFLAGS += $(if $(ASAN),$(AFLAGS))
151151CPPFLAGS += -I./include
152152CEED_LDLIBS = -lm
153153OBJDIR := build
154- LIBDIR := lib
154+ for_install := $(filter install,$(MAKECMDGOALS ) )
155+ LIBDIR := $(if $(for_install ) ,$(OBJDIR ) ,lib)
156+
155157
156158# Installation variables
157159prefix ?= /usr/local
@@ -180,7 +182,7 @@ libceed.so := $(LIBDIR)/libceed.$(SO_EXT)
180182libceed.a := $(LIBDIR ) /libceed.a
181183libceed := $(if $(STATIC ) ,$(libceed.a ) ,$(libceed.so ) )
182184CEED_LIBS = -lceed
183- libceed.c := $(filter-out interface/ceed-cuda.c interface/ceed-hip.c, $(wildcard interface/ceed* .c backends/* .c gallery/* .c) )
185+ libceed.c := $(filter-out interface/ceed-cuda.c interface/ceed-hip.c interface/ceed-jit-source-root- $( if $( for_install ) ,default,install) .c , $(wildcard interface/ceed* .c backends/* .c gallery/* .c) )
184186gallery.c := $(wildcard gallery/* /ceed* .c)
185187libceed.c += $(gallery.c )
186188libceeds = $(libceed )
@@ -624,9 +626,14 @@ $(OBJDIR)/ceed.pc : pkgconfig-prefix = $(prefix)
624626 -e " s:%prefix%:$( pkgconfig-prefix) :" \
625627 -e " s:%libs_private%:$( pkgconfig-libs-private) :" $< > $@
626628
629+ $(OBJDIR ) /interface/ceed-jit-source-root-default.o : CPPFLAGS += -DCEED_JIT_SOUCE_ROOT_DEFAULT="\"$(abspath ./include) /\""
630+ $(OBJDIR ) /interface/ceed-jit-source-root-install.o : CPPFLAGS += -DCEED_JIT_SOUCE_ROOT_DEFAULT="\"$(abspath $(includedir ) ) /\""
631+
627632install : $(libceed ) $(OBJDIR ) /ceed.pc
628633 $(INSTALL ) -d $(addprefix $(if $(DESTDIR ) ,"$(DESTDIR ) ") ,"$(includedir ) "\
629- " $( includedir) /ceed/" " $( libdir) " " $( pkgconfigdir) " )
634+ " $( includedir) /ceed/" " $( includedir) /ceed/jit-source/" \
635+ " $( includedir) /ceed/jit-source/cuda/" " $( includedir) /ceed/jit-source/hip/" \
636+ " $( includedir) /ceed/jit-source/gallery/" " $( libdir) " " $( pkgconfigdir) " )
630637 $(INSTALL_DATA ) include/ceed/ceed.h " $( DESTDIR) $( includedir) /ceed/"
631638 $(INSTALL_DATA ) include/ceed/ceed-f32.h " $( DESTDIR) $( includedir) /ceed/"
632639 $(INSTALL_DATA ) include/ceed/ceed-f64.h " $( DESTDIR) $( includedir) /ceed/"
@@ -640,6 +647,9 @@ install : $(libceed) $(OBJDIR)/ceed.pc
640647 $(INSTALL_DATA ) $(OBJDIR ) /ceed.pc " $( DESTDIR) $( pkgconfigdir) /"
641648 $(INSTALL_DATA ) include/ceed.h " $( DESTDIR) $( includedir) /"
642649 $(INSTALL_DATA ) include/ceedf.h " $( DESTDIR) $( includedir) /"
650+ $(INSTALL_DATA ) $(wildcard include/ceed/jit-source/cuda/* .h) " $( DESTDIR) $( includedir) /ceed/jit-source/cuda/"
651+ $(INSTALL_DATA ) $(wildcard include/ceed/jit-source/hip/* .h) " $( DESTDIR) $( includedir) /ceed/jit-source/hip/"
652+ $(INSTALL_DATA ) $(wildcard include/ceed/jit-source/gallery/* .h) " $( DESTDIR) $( includedir) /ceed/jit-source/gallery/"
643653
644654.PHONY : all cln clean doxygen doc lib install par print test tst prove prv prove-all junit examples style style-c style-py tidy iwyu info info-backends info-backends-all
645655
@@ -677,7 +687,7 @@ style : style-c style-py
677687CLANG_TIDY ?= clang-tidy
678688
679689% .c.tidy : % .c
680- $(CLANG_TIDY ) $(TIDY_OPTS ) $^ -- $(CPPFLAGS ) --std=c99 -I$(CUDA_DIR ) /include -I$(HIP_DIR ) /include
690+ $(CLANG_TIDY ) $(TIDY_OPTS ) $^ -- $(CPPFLAGS ) --std=c99 -I$(CUDA_DIR ) /include -I$(HIP_DIR ) /include -DCEED_JIT_SOUCE_ROOT_DEFAULT= " \" $( abspath ./include ) / \" "
681691
682692% .cpp.tidy : % .cpp
683693 $(CLANG_TIDY ) $(TIDY_OPTS ) $^ -- $(CPPFLAGS ) --std=c++11 -I$(CUDA_DIR ) /include -I$(OCCA_DIR ) /include -I$(HIP_DIR ) /include
0 commit comments