More sensible dependencies scheme for configuration

svn path=/trunk/; revision=1785
This commit is contained in:
David Welch 2001-04-10 22:13:23 +00:00
parent 78232dab8b
commit 33267a7bd2
5 changed files with 49 additions and 28 deletions

View file

@ -4,4 +4,6 @@ ntoskrnl.coff
objects
temp.exp
depends
depends.exe
depends.exe
mkconfig
mkconfig.exe

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.31 2001/04/10 17:48:16 dwelch Exp $
# $Id: Makefile,v 1.32 2001/04/10 22:13:22 dwelch Exp $
#
# ReactOS Operating System
#
@ -9,24 +9,9 @@
PATH_TO_TOP := ..
#
# Architecture to build for
# Include details of the kernel configuration
#
ARCH := i386
#
# Whether to compile in the kernel debugger
#
KDBG := 1
#
# Whether to compile for debugging
#
DBG := 1
#
# Whether to compile a multiprocessor or single processor version
#
MP := 0
include config
#
#
@ -62,7 +47,7 @@ CFLAGS = -Iinclude -D__NTOSKRNL__ $(CFLAGS_DBG) -Wall -Werror
include $(PATH_TO_TOP)/rules.mak
all: config $(EXE_PREFIX)depends$(EXE_POSTFIX) \
all: $(EXE_PREFIX)depends$(EXE_POSTFIX) \
$(OBJECTS_PATH) \
$(TARGETNAME).nostrip.exe \
$(TARGETNAME).exe \
@ -616,12 +601,12 @@ ke/main.o: ke/main.c ../include/reactos/buildno.h
mkconfig$(EXE_SUFFIX): mkconfig.c
$(HOST_CC) -g -o mkconfig$(EXE_SUFFIX) mkconfig.c
config:
$(EXE_PREFIX)mkconfig$(EXE_SUFFIX) include/internal/config.h $(CONFIG)
.PHONY: config
include/internal/config.h: config mkconfig$(EXE_SUFFIX)
$(EXE_PREFIX)mkconfig$(EXE_SUFFIX) include/internal/config.h$(CONFIG)
ifneq ($(MAKECMDGOALS),clean)
include $(D1_FILES)
endif
.%.d: %.c $(EXE_PREFIX)depends$(EXE_POSTFIX)
$(CC) $(CFLAGS) -M $< | $(EXE_PREFIX)depends$(EXE_POSTFIX) $(@D) $@

19
reactos/ntoskrnl/config Normal file
View file

@ -0,0 +1,19 @@
#
# Architecture to build for
#
ARCH := i386
#
# Whether to compile in the kernel debugger
#
KDBG := 0
#
# Whether to compile for debugging
#
DBG := 1
#
# Whether to compile a multiprocessor or single processor version
#
MP := 0

View file

@ -1,4 +1,7 @@
/* Automatically generated, don't edit */
/* Automatically generated, Edit the Makefile to change configuration */
#ifndef __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H
#define __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H
#define DBG
#define KDBG
#define UP
#define CONFIG "DBG UP"
#endif /* __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H */

View file

@ -44,7 +44,7 @@ write_if_change(char* outbuf, char* filename)
fclose(out);
return(1);
}
if (memcmp(cmpbuf, outbuf, max(end, strlen(outbuf))) == 0)
if (end == strlen(outbuf) && memcmp(cmpbuf, outbuf, end) == 0)
{
fclose(out);
return(0);
@ -75,6 +75,7 @@ main(int argc, char* argv[])
unsigned int i;
char* outbuf;
char* s;
char config[512];
if (argc == 1)
{
@ -90,11 +91,22 @@ main(int argc, char* argv[])
}
s = outbuf;
s = s + sprintf(s, "/* Automatically generated, don't edit */\n");
s = s + sprintf(s, "/* Automatically generated, ");
s = s + sprintf(s, "Edit the Makefile to change configuration */\n");
s = s + sprintf(s, "#ifndef __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H\n");
s = s + sprintf(s, "#define __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H\n");
strcpy(config, "");
for (i = 2; i < argc; i++)
{
s = s + sprintf(s, "#define %s\n", argv[i]);
strcat(config, argv[i]);
if (i != (argc - 1))
{
strcat(config, " ");
}
}
s = s + sprintf(s, "#define CONFIG \"%s\"\n", config);
s = s + sprintf(s, "#endif /* __NTOSKRNL_INCLUDE_INTERNAL_CONFIG_H */\n");
return(write_if_change(outbuf, argv[1]));
}