From 1b1afc9539e41805fec24d9e29c7095ff2839865 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Sun, 13 Apr 2003 03:24:28 +0000 Subject: [PATCH] - the build system now handles static libraries 0.5% better - cabman: brand new makefile - uses TARGET_* macros, the build helper, and the zlib library properly - fmifs: static libraries (.a archives) are built directly into the dk/w32/lib directory, instead of their base directory, so the makefile has been fixed - psapi: split into PSAPI.dll and EPSAPI (Extended PSAPI), renamed some files, new header - zlib: cleaned up makefile from unnecessary hacks svn path=/trunk/; revision=4528 --- reactos/Makefile | 2 +- reactos/apps/utils/cabman/main.cpp | 2 +- reactos/apps/utils/cabman/makefile | 64 ++++--------------- .../internal/psapi.h => include/epsapi.h} | 2 +- reactos/lib/{psapi => epsapi}/enum/drivers.c | 9 ++- .../enum/module.c => epsapi/enum/modules.c} | 10 ++- .../process.c => epsapi/enum/processes.c} | 9 ++- reactos/lib/epsapi/makefile | 18 ++++++ reactos/lib/fmifs/makefile | 6 +- reactos/lib/psapi/makefile | 12 ++-- reactos/lib/psapi/misc/win32.c | 4 +- reactos/lib/zlib/Makefile | 7 +- reactos/tools/helper.mk | 9 ++- 13 files changed, 70 insertions(+), 84 deletions(-) rename reactos/{lib/psapi/include/internal/psapi.h => include/epsapi.h} (98%) rename reactos/lib/{psapi => epsapi}/enum/drivers.c (92%) rename reactos/lib/{psapi/enum/module.c => epsapi/enum/modules.c} (91%) rename reactos/lib/{psapi/enum/process.c => epsapi/enum/processes.c} (95%) create mode 100644 reactos/lib/epsapi/makefile diff --git a/reactos/Makefile b/reactos/Makefile index 76f2033f29f..31c982e8000 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -34,7 +34,7 @@ LIB_FSLIB = vfatlib # advapi32 crtdll fmifs gdi32 kernel32 libpcap packet msafd msvcrt ntdll ole32 # oleaut32 psapi rpcrt4 secur32 shell32 user32 version ws2help ws2_32 wsock32 wshirda DLLS = advapi32 crtdll fmifs freetype gdi32 kernel32 packet msafd msvcrt ntdll \ - secur32 user32 version winedbgc ws2help ws2_32 wshirda zlib #winmm + secur32 user32 version winedbgc ws2help ws2_32 wshirda zlib epsapi #winmm SUBSYS = smss win32k csrss ntvdm diff --git a/reactos/apps/utils/cabman/main.cpp b/reactos/apps/utils/cabman/main.cpp index d269f621c40..055926eea7d 100644 --- a/reactos/apps/utils/cabman/main.cpp +++ b/reactos/apps/utils/cabman/main.cpp @@ -474,7 +474,7 @@ VOID CCABManager::OnAdd(PCFFILE File, } -INT main(INT argc, PCHAR argv[]) +int main(int argc, char * argv[]) /* * FUNCTION: Main entry point * ARGUMENTS: diff --git a/reactos/apps/utils/cabman/makefile b/reactos/apps/utils/cabman/makefile index cced1b18274..3f14c83cbbe 100644 --- a/reactos/apps/utils/cabman/makefile +++ b/reactos/apps/utils/cabman/makefile @@ -1,64 +1,26 @@ -# -# Makefile for ReactOS Cabinet Manager -# +# $Id: makefile,v 1.8 2003/04/13 03:24:26 hyperion Exp $ + PATH_TO_TOP = ../../.. -#FIXME: why doesn't this work? -#ZLIB_OBJECTS = $(PATH_TO_TOP)/drivers/lib/zlib/zlib.a -ZLIB_PATH = $(PATH_TO_TOP)/drivers/lib/zlib +TARGET_TYPE = program -ZLIB_OBJECTS = $(ZLIB_PATH)/adler32.o $(ZLIB_PATH)/deflate.o \ - $(ZLIB_PATH)/infblock.o $(ZLIB_PATH)/infcodes.o \ - $(ZLIB_PATH)/inflate.o $(ZLIB_PATH)/inftrees.o \ - $(ZLIB_PATH)/infutil.o $(ZLIB_PATH)/inffast.o \ - $(ZLIB_PATH)/trees.o $(ZLIB_PATH)/zutil.o -ENGINE_OBJECTS = $(ZLIB_OBJECTS) cabinet.o mszip.o raw.o -TEST_OBJECTS = $(ENGINE_OBJECTS) test.o -OBJECTS = $(ENGINE_OBJECTS) main.o dfp.o -TARGET = cabman -PROGS = $(TARGET).exe test.exe +TARGET_APPTYPE = console -#FIXME: zlib should be compiled and installed in the SDK by the master makefile -CFLAGS += -O3 -I$(ZLIB_PATH) +TARGET_NAME = cabman -CLEAN_FILES = *.o $(TARGET).exe $(TARGET).sym test.exe test.sym +TARGET_OBJECTS = cabinet.o mszip.o raw.o main.o dfp.o -all: $(PROGS) +TARGET_SDKLIBS = zlib.a -clean: - - $(RM) $(CLEAN_FILES) +TARGET_CFLAGS = -I$(PATH_TO_TOP)/lib/zlib -.phony: clean +TARGET_CPPFLAGS = $(TARGET_CFLAGS) -install: $(PROGS:%=$(FLOPPY_DIR)/apps/%) +TARGET_GCCLIBS = stdc++ -$(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: % -ifeq ($(DOSCLI),yes) - $(CP) $* $(FLOPPY_DIR)\apps\$* -else - $(CP) $* $(FLOPPY_DIR)/apps/$* -endif +TARGET_NORC = yes -dist: $(PROGS:%=../../$(DIST_DIR)/apps/%) +include $(PATH_TO_TOP)/rules.mak -$(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: % -ifeq ($(DOSCLI),yes) - $(CP) $* ..\..\$(DIST_DIR)\apps\$* -else - $(CP) $* ../../$(DIST_DIR)/apps/$* -endif - -#FIXME: zlib should be compiled and installed in the SDK by the master makefile -$(ZLIB_PATH)/zlib.a: - $(MAKE) -C $(ZLIB_PATH) -f makefile.reactos - -$(TARGET).exe: $(OBJECTS) $(ZLIB_PATH)/zlib.a - $(CC) $(OBJECTS) -lstdc++ -o $(TARGET).exe - $(NM) --numeric-sort $(TARGET).exe > $(TARGET).sym - -test.exe: $(TEST_OBJECTS) - $(CC) $(TEST_OBJECTS) -lstdc++ -o test.exe - $(NM) --numeric-sort test.exe > test.sym - -include ../../../rules.mak +include $(TOOLS_PATH)/helper.mk diff --git a/reactos/lib/psapi/include/internal/psapi.h b/reactos/include/epsapi.h similarity index 98% rename from reactos/lib/psapi/include/internal/psapi.h rename to reactos/include/epsapi.h index b5428c3793e..f4ce23b219d 100644 --- a/reactos/lib/psapi/include/internal/psapi.h +++ b/reactos/include/epsapi.h @@ -1,4 +1,4 @@ -/* $Id: psapi.h,v 1.5 2003/04/03 00:06:24 hyperion Exp $ +/* $Id: epsapi.h,v 1.1 2003/04/13 03:24:27 hyperion Exp $ */ /* * internal/psapi.h diff --git a/reactos/lib/psapi/enum/drivers.c b/reactos/lib/epsapi/enum/drivers.c similarity index 92% rename from reactos/lib/psapi/enum/drivers.c rename to reactos/lib/epsapi/enum/drivers.c index f6e60fd33ec..43ba4f3ac7d 100644 --- a/reactos/lib/psapi/enum/drivers.c +++ b/reactos/lib/epsapi/enum/drivers.c @@ -1,21 +1,24 @@ -/* $Id: drivers.c,v 1.1 2003/04/03 00:06:23 hyperion Exp $ +/* $Id: drivers.c,v 1.1 2003/04/13 03:24:27 hyperion Exp $ */ /* * COPYRIGHT: See COPYING in the top level directory * LICENSE: See LGPL.txt in the top level directory * PROJECT: ReactOS system libraries - * FILE: reactos/lib/psapi/enum/drivers.c + * FILE: reactos/lib/epsapi/enum/drivers.c * PURPOSE: Enumerate system modules * PROGRAMMER: KJK::Hyperion * UPDATE HISTORY: * 02/04/2003: Created + * 12/04/2003: internal PSAPI renamed EPSAPI (Extended PSAPI) and + * isolated in its own library to clear the confusion + * and improve reusability */ #include #include #include -#include "internal/psapi.h" +#include NTSTATUS NTAPI diff --git a/reactos/lib/psapi/enum/module.c b/reactos/lib/epsapi/enum/modules.c similarity index 91% rename from reactos/lib/psapi/enum/module.c rename to reactos/lib/epsapi/enum/modules.c index b0eda761c1a..d671de68e04 100644 --- a/reactos/lib/psapi/enum/module.c +++ b/reactos/lib/epsapi/enum/modules.c @@ -1,10 +1,10 @@ -/* $Id: module.c,v 1.5 2003/04/03 00:06:23 hyperion Exp $ +/* $Id: modules.c,v 1.1 2003/04/13 03:24:27 hyperion Exp $ */ /* * COPYRIGHT: See COPYING in the top level directory * LICENSE: See LGPL.txt in the top level directory * PROJECT: ReactOS system libraries - * FILE: reactos/lib/psapi/enum/module.c + * FILE: reactos/lib/epsapi/enum/module.c * PURPOSE: Enumerate process modules * PROGRAMMER: KJK::Hyperion * UPDATE HISTORY: @@ -14,13 +14,17 @@ * 12/02/2003: malloc and free renamed to PsaiMalloc and PsaiFree, * for better reusability * 02/04/2003: System modules enumeration moved into its own file + * 12/04/2003: internal PSAPI renamed EPSAPI (Extended PSAPI) and + * isolated in its own library to clear the confusion + * and improve reusability */ #include #include -#include #include +#include + NTSTATUS NTAPI PsaEnumerateProcessModules diff --git a/reactos/lib/psapi/enum/process.c b/reactos/lib/epsapi/enum/processes.c similarity index 95% rename from reactos/lib/psapi/enum/process.c rename to reactos/lib/epsapi/enum/processes.c index cd1da03f3fc..2c0e3453a31 100644 --- a/reactos/lib/psapi/enum/process.c +++ b/reactos/lib/epsapi/enum/processes.c @@ -1,10 +1,10 @@ -/* $Id: process.c,v 1.6 2003/04/04 20:35:24 hyperion Exp $ +/* $Id: processes.c,v 1.1 2003/04/13 03:24:27 hyperion Exp $ */ /* * COPYRIGHT: See COPYING in the top level directory * LICENSE: See LGPL.txt in the top level directory * PROJECT: ReactOS system libraries - * FILE: reactos/lib/psapi/enum/process.c + * FILE: reactos/lib/epsapi/enum/processes.c * PURPOSE: Enumerate processes and threads * PROGRAMMER: KJK::Hyperion * UPDATE HISTORY: @@ -26,13 +26,16 @@ * - PsaEnumerateProcessesAndThreads * - PsaEnumerateProcesses * - PsaEnumerateThreads + * 12/04/2003: internal PSAPI renamed EPSAPI (Extended PSAPI) and + * isolated in its own library to clear the confusion + * and improve reusability */ #include #include #include -#include "internal/psapi.h" +#include NTSTATUS NTAPI diff --git a/reactos/lib/epsapi/makefile b/reactos/lib/epsapi/makefile new file mode 100644 index 00000000000..66f46331e05 --- /dev/null +++ b/reactos/lib/epsapi/makefile @@ -0,0 +1,18 @@ +# $Id: makefile,v 1.1 2003/04/13 03:24:27 hyperion Exp $ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = library + +TARGET_NAME = epsapi + +TARGET_OBJECTS = \ + enum/drivers.o \ + enum/modules.o \ + enum/processes.o + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF diff --git a/reactos/lib/fmifs/makefile b/reactos/lib/fmifs/makefile index 3bdca1451c1..004b0e95363 100644 --- a/reactos/lib/fmifs/makefile +++ b/reactos/lib/fmifs/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.16 2003/04/05 23:17:21 chorns Exp $ +# $Id: makefile,v 1.17 2003/04/13 03:24:26 hyperion Exp $ PATH_TO_TOP = ../.. @@ -12,9 +12,7 @@ TARGET_CFLAGS = -fno-builtin TARGET_LFLAGS = -nostdlib -nostartfiles -TARGET_SDKLIBS = ntdll.a kernel32.a - -TARGET_LIBS = $(PATH_TO_TOP)/lib/fslib/vfatlib/vfatlib.a +TARGET_SDKLIBS = vfatlib.a ntdll.a kernel32.a TARGET_OBJECTS = \ chkdsk.o \ diff --git a/reactos/lib/psapi/makefile b/reactos/lib/psapi/makefile index 9bdec3100d7..9697b7f7614 100644 --- a/reactos/lib/psapi/makefile +++ b/reactos/lib/psapi/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.5 2003/04/03 00:06:24 hyperion Exp $ +# $Id: makefile,v 1.6 2003/04/13 03:24:26 hyperion Exp $ PATH_TO_TOP = ../.. @@ -6,9 +6,9 @@ TARGET_TYPE = dynlink TARGET_NAME = psapi -TARGET_SDKLIBS = ntdll.a kernel32.a +TARGET_SDKLIBS = epsapi.a ntdll.a kernel32.a -TARGET_CFLAGS = -I./include -Wall +TARGET_CFLAGS = -I./include TARGET_LFLAGS = -nostartfiles -nostdlib @@ -18,12 +18,10 @@ TARGET_OBJECTS = \ misc/dllmain.o \ misc/malloc.o \ misc/stubs.o \ - misc/win32.o \ - enum/module.o \ - enum/process.o \ - enum/drivers.o + misc/win32.o include $(PATH_TO_TOP)/rules.mak + include $(TOOLS_PATH)/helper.mk # EOF diff --git a/reactos/lib/psapi/misc/win32.c b/reactos/lib/psapi/misc/win32.c index fe71bd988d9..95605dc5270 100644 --- a/reactos/lib/psapi/misc/win32.c +++ b/reactos/lib/psapi/misc/win32.c @@ -1,4 +1,4 @@ -/* $Id: win32.c,v 1.7 2003/04/03 00:06:24 hyperion Exp $ +/* $Id: win32.c,v 1.8 2003/04/13 03:24:26 hyperion Exp $ */ /* * COPYRIGHT: See COPYING in the top level directory @@ -17,7 +17,7 @@ #include #include #include -#include +#include /* EmptyWorkingSet */ BOOL STDCALL EmptyWorkingSet(HANDLE hProcess) diff --git a/reactos/lib/zlib/Makefile b/reactos/lib/zlib/Makefile index 46d2c500f37..96c12b6bdc8 100644 --- a/reactos/lib/zlib/Makefile +++ b/reactos/lib/zlib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2003/04/05 19:40:41 chorns Exp $ +# $Id: Makefile,v 1.3 2003/04/13 03:24:26 hyperion Exp $ PATH_TO_TOP = ../.. @@ -6,8 +6,6 @@ TARGET_TYPE = library TARGET_NAME = zlib -TARGET_NORC = yes - TARGET_CFLAGS = \ -MMD -O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -Wstrict-prototypes -Wmissing-prototypes @@ -20,7 +18,4 @@ include $(PATH_TO_TOP)/rules.mak include $(TOOLS_PATH)/helper.mk -zlib.sym: - @echo FIXME!>$@ - # EOF diff --git a/reactos/tools/helper.mk b/reactos/tools/helper.mk index 810ee6ed62c..0380591757e 100644 --- a/reactos/tools/helper.mk +++ b/reactos/tools/helper.mk @@ -1,4 +1,4 @@ -# $Id: helper.mk,v 1.32 2003/04/05 23:17:22 chorns Exp $ +# $Id: helper.mk,v 1.33 2003/04/13 03:24:26 hyperion Exp $ # # Helper makefile for ReactOS modules # Variables this makefile accepts: @@ -509,7 +509,12 @@ TARGET_NFLAGS += $(MK_NFLAGS) MK_GCCLIBS := $(addprefix -l, $(TARGET_GCCLIBS)) -MK_FULLNAME := $(MK_BASENAME)$(MK_EXT) +ifeq ($(MK_MODE),static) + MK_FULLNAME := $(SDK_PATH_LIB)/$(MK_BASENAME)$(MK_EXT) +else + MK_FULLNAME := $(MK_BASENAME)$(MK_EXT) +endif + MK_IMPLIB_FULLNAME := $(MK_BASENAME)$(MK_IMPLIB_EXT) MK_NOSTRIPNAME := $(MK_BASENAME).nostrip$(MK_EXT)