reactos/tools
diff -u -r1.21 -r1.22
--- depend.mk 17 Aug 2004 13:53:05 -0000 1.21
+++ depend.mk 7 Sep 2004 08:20:06 -0000 1.22
@@ -6,6 +6,19 @@
ifneq ($(MAKECMDGOALS),implib)
DEP_FILTERED := $(filter-out $(DEP_EXCLUDE_FILTER), $(DEP_OBJECTS:.o=.d))
+
+PCH :=
+
+ifeq ($(ROS_USE_PCH),yes)
+ifneq ($(TARGET_PCH),)
+
+PCH = $(TARGET_PCH).gch
+
+DEP_FILTERED := $(DEP_FILTERED) $(TARGET_PCH:.h=.d)
+
+endif # TARGET_PCH
+endif
+
DEP_FILES := $(join $(dir $(DEP_FILTERED)), $(addprefix ., $(notdir $(DEP_FILTERED))))
ifneq ($(MAKECMDGOALS),clean)
@@ -27,14 +40,17 @@
.%.d: %.cpp $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
$(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
-.%.d: %.s $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
+.%.d: %.S $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
$(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
-.%.d: %.S $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
+.%.d: %.s $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
$(CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
.%.d: %.asm $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
$(NASM_CMD) $(NFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
+.%.d: %.h $(PATH_TO_TOP)/tools/depends$(EXE_POSTFIX) $(GENERATED_HEADER_FILES)
+ $(PCH_CC) $(CFLAGS) -M $< | $(DEPENDS_PATH)$(SEP)depends$(EXE_POSTFIX) $(@D) $@
+
endif
endif
reactos/tools
diff -u -r1.77 -r1.78
--- helper.mk 27 Aug 2004 18:24:28 -0000 1.77
+++ helper.mk 7 Sep 2004 08:20:06 -0000 1.78
@@ -1,4 +1,4 @@
-# $Id: helper.mk,v 1.77 2004/08/27 18:24:28 arty Exp $
+# $Id: helper.mk,v 1.78 2004/09/07 08:20:06 hbirr Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
@@ -657,6 +657,7 @@
--output-lib $(MK_IMPLIBPATH)/$(MK_BASENAME).a \
--kill-at
+
else # MK_IMPLIBONLY
all: $(REGTEST_TARGETS) $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(SUBDIRS:%=%_all)
@@ -722,8 +723,7 @@
$(MK_FULLNAME): $(MK_NOSTRIPNAME) $(MK_EXTRADEP)
-
ifneq ($(TARGET_CPPAPP),yes)
- $(LD) -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
- $(STRIP) --strip-debug $(MK_STRIPPED_OBJECT)
+ $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
endif
ifeq ($(MK_EXETYPE),dll)
$(LD_CC) -Wl,--base-file,base.tmp \
@@ -809,8 +809,7 @@
$(MK_FULLNAME): $(MK_FULLRES) $(MK_OBJECTS) $(MK_EXTRADEP) $(MK_LIBS) $(MK_NOSTRIPNAME)
-
ifneq ($(TARGET_CPPAPP),yes)
- $(LD) -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
- $(STRIP) --strip-debug $(MK_STRIPPED_OBJECT)
+ $(LD) --strip-debug -r -o $(MK_STRIPPED_OBJECT) $(MK_OBJECTS)
endif
$(LD_CC) -Wl,--base-file,base.tmp \
-Wl,--entry,$(TARGET_ENTRY) \
@@ -894,31 +893,19 @@
PCH_CC := $(CC)
endif
-# GCC generates wrong dependencies for header files.
-MK_PCHFAKE = $(TARGET_PCH:.h=.o)
-$(MK_PCHFAKE):
- - $(RTOUCH) $(MK_PCHFAKE)
-
-$(MK_PCHNAME): depend.d
- - $(RTOUCH) $(MK_PCHNAME)
- - $(PCH_CC) $(TARGET_CFLAGS) $(TARGET_PCH)
-
-depend.d: $(MK_PCHFAKE)
- - $(RTOUCH) depend.d
- - $(PCH_CC) $(TARGET_CFLAGS) $(TARGET_PCH) -M -MF depend.d
-
--include depend.d
endif # TARGET_PCH
+else #
+MK_PCHNAME =
endif # ROS_USE_PCH
# Be carefull not to clean non-object files
MK_CLEANFILES := $(filter %.o,$(MK_OBJECTS))
-MK_CLEANFILTERED := $(MK_OBJECTS:.o=.d)
+MK_CLEANFILTERED := $(MK_OBJECTS:.o=.d) $(TARGET_PCH:.h=.d)
MK_CLEANDEPS := $(join $(dir $(MK_CLEANFILTERED)), $(addprefix ., $(notdir $(MK_CLEANFILTERED))))
clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean)
- - $(RM) *.o depend.d $(MK_PCHNAME) *.gch $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
+ - $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \
$(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \
junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_GENERATED_MAKEFILE) \
$(TARGET_CLEAN)
@@ -1062,11 +1049,11 @@
%.o: %.c $(MK_PCHNAME)
$(CC) $(TARGET_CFLAGS) -c $< -o $@
-%.o: %.cc
+%.o: %.cc $(MK_PCHNAME)
$(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
-%.o: %.cxx
+%.o: %.cxx $(MK_PCHNAME)
$(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
-%.o: %.cpp
+%.o: %.cpp $(MK_PCHNANE)
$(CXX) $(TARGET_CPPFLAGS) -c $< -o $@
%.o: %.S
$(AS) $(TARGET_ASFLAGS) -c $< -o $@
@@ -1082,7 +1069,8 @@
$(WINEBUILD) $(DEFS) -o $@ --def $<
%.i: %.c
$(CC) $(TARGET_CFLAGS) -E $< > $@
-
+%.h.gch: %.h
+ $(PCH_CC) $(CFLAGS) $<
# rule for msvc conversion
%.c: %_msvc.c
$(MS2PS) -try try -except except -finally finally < $< > $@
reactos/ntoskrnl
diff -u -r1.140 -r1.141
--- Makefile 26 Aug 2004 16:04:49 -0000 1.140
+++ Makefile 7 Sep 2004 08:20:06 -0000 1.141
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.140 2004/08/26 16:04:49 blight Exp $
+# $Id: Makefile,v 1.141 2004/09/07 08:20:06 hbirr Exp $
#
# ReactOS Operating System
#
@@ -386,6 +386,20 @@
TAG_OBJECTS := $(join $(dir $(DEP_OBJECTS)),$(patsubst %.o, .%.TAG, $(notdir $(DEP_OBJECTS))))
+TARGET_PCH = include/ntoskrnl.h
+
+# Precompiled header support
+# When using PCHs, use dependency tracking to keep the .gch files up-to-date.
+
+MK_PCHNAME =
+ifeq ($(ROS_USE_PCH),yes)
+MK_PCHNAME = $(TARGET_PCH).gch
+
+PCH_CC := $(CC)
+
+
+endif # ROS_USE_PCH
+
#
# Include automatic dependancy tracking
#
@@ -731,38 +745,7 @@
ke/main.o: ke/main.c $(PATH_TO_TOP)/include/reactos/buildno.h
-TARGET_PCH = include/ntoskrnl.h
-
-# Precompiled header support
-# When using PCHs, use dependency tracking to keep the .gch files up-to-date.
-
-MK_PCHNAME =
-ifeq ($(ROS_USE_PCH),yes)
-MK_PCHNAME = $(TARGET_PCH).gch
-
-PCH_CC := $(CC)
-
-# GCC generates wrong dependencies for header files.
-MK_PCHFAKE = $(TARGET_PCH:.h=.o)
-ifneq ($(MAKECMDGOALS),clean)
-$(MK_PCHFAKE):
- - $(RTOUCH) $(MK_PCHFAKE)
-
-$(MK_PCHNAME): depend.d
- - $(RTOUCH) $(MK_PCHNAME)
- - $(PCH_CC) $(CFLAGS) $(TARGET_PCH)
-
-depend.d: $(MK_PCHFAKE) $(PATH_TO_TOP)/include/reactos/bugcodes.h
- - $(RTOUCH) depend.d
- - $(PCH_CC) $(CFLAGS) $(TARGET_PCH) -M -MF depend.d
-
--include depend.d
-
-endif
-
-endif # ROS_USE_PCH
-
-%.o: %.cc
+%.o: %.cc $(MK_PCHNAME)
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.c $(MK_PCHNAME)
$(CC) $(CFLAGS) -c $< -o $@
@@ -774,6 +757,9 @@
$(NASM_CMD) $(NFLAGS) $< -o $@
%.coff: %.rc
$(RC) $(RCFLAGS) $< -o $@
+%.h.gch: %.h
+ $(PCH_CC) $(CFLAGS) $<
+
#
#