Further dependency tracking fixes

svn path=/trunk/; revision=1691
This commit is contained in:
David Welch 2001-03-15 18:37:29 +00:00
parent 6fc1bdc912
commit c3c30d0692
3 changed files with 52 additions and 8 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.19 2001/03/14 16:30:08 dwelch Exp $
# $Id: Makefile,v 1.20 2001/03/15 18:37:29 dwelch Exp $
#
# ReactOS Operating System
#
@ -19,11 +19,14 @@ CFLAGS = -Iinclude -D__NTOSKRNL__ -DDBG -g -Wall -Werror
# -Wmissing-prototypes -Wshadow\
#CFLAGS += -DDBGPRINT_FILE_LOG
all: \
all: depends$(EXE_POSTFIX) \
$(OBJECTS_PATH) \
$(TARGETNAME).nostrip.exe \
$(TARGETNAME).exe
depends$(EXE_POSTFIX): depends.c
$(HOST_CC) -o depends$(EXE_POSTFIX) depends.c
#
# Hardware Abstraction Layer (Hal)
# Defines $(OBJECTS_HAL)
@ -569,15 +572,14 @@ ke/main.o: ke/main.c ../include/reactos/buildno.h
include $(D1_FILES)
.%.d: %.c
$(CC) $(CFLAGS) -M $< | sed -f depends.sed | sed -e s#$(*F)$(DOT)o#$(@D)/$(*F).o#g -e s#$(DOT)$(*F)$(DOT)d#$(@D)/.$(*F).d#g > $@
.%.d: %.c depends$(EXE_POSTFIX)
$(CC) $(CFLAGS) -M $< | $(EXE_PREFIX)depends$(EXE_POSTFIX) $(@D) > $@
.%.d: %.s
$(CC) $(CFLAGS) -M $< | sed -f depends.sed | sed -e s#$(*F)$(DOT)o#$(@D)/$(*F).o#g -e s#$(DOT)$(*F)$(DOT)d#$(@D)/.$(*F).d#g > $@
$(CC) $(CFLAGS) -M $< | $(EXE_PREFIX)depends$(EXE_POSTFIX) $(@D) > $@
.%.d: %.S
$(CC) $(CFLAGS) -M $< | sed -f depends.sed | sed -e s#$(*F)$(DOT)o#$(@D)/$(*F).o#g -e s#$(DOT)$(*F)$(DOT)d#$(@D)/.$(*F).d#g > $@
$(CC) $(CFLAGS) -M $< | $(EXE_PREFIX)depends$(EXE_POSTFIX) $(@D)
include $(PATH_TO_TOP)/rules.mak

View file

@ -0,0 +1,43 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[])
{
char buf[512];
char ch;
unsigned int i;
char* dot;
char* prefix;
if (argc == 1)
{
prefix = "";
}
else
{
prefix = strdup(argv[1]);
}
i = 0;
while ((ch = fgetc(stdin)) != ':')
{
buf[i] = ch;
i++;
}
buf[i] = 0;
dot = strrchr(buf, '.');
if (dot != NULL)
{
*dot = 0;
}
fprintf(stdout, "%s/.%s.d %s/%s.o:", prefix, buf, prefix,buf);
while ((ch = fgetc(stdin)) != EOF)
{
fputc(ch, stdout);
}
return(0);
}

View file

@ -1 +0,0 @@
s@^\(.*\)\.o:@.\1.d \1.o:@