-# $Id: helper.mk,v 1.10 2002/01/08 00:49:02 dwelch Exp $
+# $Id: helper.mk,v 1.12 2002/04/29 23:02:12 hyperion Exp $
#
# Helper makefile for ReactOS modules
# Variables this makefile accepts:
# program = User mode program
# proglib = Executable program that have exported functions
# dynlink = Dynamic Link Library (DLL)
-# library = Import library that will be linked with other code
+# library = Library that will be linked with other code
# driver_library = Import library for a driver
# driver = Kernel mode driver
# export_driver = Kernel mode driver that have exported functions
endif
ifeq ($(TARGET_TYPE),library)
- MK_MODE := user
- MK_EXETYPE := dll
+ MK_MODE := static
+ MK_EXETYPE :=
MK_DEFEXT := .a
MK_DEFENTRY :=
MK_DDKLIBS :=
MK_CPPFLAGS := -I./ -I$(SDK_PATH_INC)
MK_RCFLAGS := --include-dir $(SDK_PATH_INC)
MK_IMPLIB := no
- MK_IMPLIBONLY := yes
- MK_IMPLIBDEFPATH := $(SDK_PATH_LIB)
- MK_IMPLIB_EXT := .a
+ MK_IMPLIBONLY := no
+ MK_IMPLIBDEFPATH :=
+ MK_IMPLIB_EXT :=
MK_INSTALLDIR := $(SDK_PATH_INC)
MK_DISTDIR := # FIXME
- MK_RES_BASE :=
+ MK_RES_BASE :=
endif
ifeq ($(TARGET_TYPE),driver_library)
--base-file base.tmp \
--output-exp temp.exp $(MK_EXTRACMD)
- $(RM) base.tmp
- $(CC) $(TARGET_LFLAGS) \
+ $(CC) \
-Wl,--subsystem,native \
-Wl,--image-base,$(TARGET_BASE) \
-Wl,--file-alignment,0x1000 \
-Wl,--section-alignment,0x1000 \
-Wl,--entry,$(TARGET_ENTRY) \
-Wl,temp.exp \
+ $(TARGET_LFLAGS) \
-mdll -nostartfiles -nostdlib \
-o $(MK_NOSTRIPNAME) \
$(MK_FULLRES) $(MK_OBJECTS) $(MK_LIBS) $(MK_GCCLIBS)
--base-file base.tmp \
--output-exp temp.exp $(MK_EXTRACMD)
- $(RM) base.tmp
- $(CC) $(TARGET_LFLAGS) \
+ $(CC) \
-Wl,--subsystem,native \
-Wl,--image-base,$(TARGET_BASE) \
-Wl,--file-alignment,0x1000 \
-Wl,--section-alignment,0x1000 \
-Wl,--entry,$(TARGET_ENTRY) \
-Wl,temp.exp \
+ $(TARGET_LFLAGS) \
-mdll -nostartfiles -nostdlib \
-o $(MK_FULLNAME) \
$(MK_FULLRES) $(MK_STRIPPED_OBJECT) $(MK_LIBS) $(MK_GCCLIBS)
endif # MK_MODE
+# Static library target
+ifeq ($(MK_MODE),static)
+
+$(MK_NOSTRIPNAME): $(TARGET_OBJECTS)
+ $(AR) -r $(MK_NOSTRIPNAME) $(TARGET_OBJECTS)
+
+# FIXME: dummy rule
+$(MK_FULLNAME): $(MK_NOSTRIPNAME)
+ $(CP) $(MK_NOSTRIPNAME) $(MK_FULLNAME)
+
+endif # MK_MODE
+
endif # MK_IMPLIBONLY