Fixed masking/casting logic in commit log printf.
[riscv-isa-sim.git] / Makefile.in
index 1f3074d6bbc7d4691ffa7f2f264a4153fd487d73..5ae226f90ed2319d114bb7e3fed3b00186980f36 100644 (file)
@@ -87,7 +87,7 @@ CXX           := @CXX@
 CFLAGS        += @CFLAGS@ -DPREFIX=\"$(prefix)\"
 CPPFLAGS      += @CPPFLAGS@
 CXXFLAGS      += @CXXFLAGS@ -DPREFIX=\"$(prefix)\"
-COMPILE       := $(CXX) -fPIC -MMD -MP $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) \
+COMPILE       := $(CXX) -fPIC -MMD -MP $(CPPFLAGS) $(CXXFLAGS) \
                  $(sprojs_include)
 COMPILE_C     := $(CC) -fPIC -MMD -MP $(CPPFLAGS) $(CFLAGS) \
                  $(sprojs_include)
@@ -184,16 +184,22 @@ _$(1).cc :
 
 # Build the object files for this subproject
 
+$(2)_pch := $$(patsubst %.h, %.h.gch, $$($(2)_precompiled_hdrs))
 $(2)_objs := $$(patsubst %.cc, %.o, $$($(2)_srcs))
 $(2)_c_objs := $$(patsubst %.c, %.o, $$($(2)_c_srcs))
 $(2)_deps := $$(patsubst %.o, %.d, $$($(2)_objs))
 $(2)_c_deps := $$(patsubst %.o, %.d, $$($(2)_c_objs))
-$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs)
+$(2)_pch_deps := $$(patsubst %.h, %.d, $$($(2)_precompiled_hdrs))
+$$($(2)_pch) : %.h.gch : %.h
+       $(COMPILE) $$<
+# If using clang, don't depend (and thus don't build) precompiled headers
+$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs) $(if $(filter-out clang,$(CC)),$$($(2)_pch))
        $(COMPILE) -c $$<
 $$($(2)_c_objs) : %.o : %.c $$($(2)_gen_hdrs)
        $(COMPILE_C) -c $$<
 
-$(2)_junk += $$($(2)_objs) $$($(2)_c_objs) $$($(2)_deps) $$($(2)_c_deps) $$($(2)_gen_hdrs)
+$(2)_junk += $$(addprefix $(src_dir)/$(1)/, $$($(2)_pch)) \
+  $$($(2)_objs) $$($(2)_c_objs) $$($(2)_deps) $$($(2)_c_deps) $$($(2)_gen_hdrs) $$($(2)_pch_deps)
 
 # Reverse the dependency list so that a given subproject only depends on
 # subprojects listed to its right. This is the correct order for linking