g++ 生成dll(makefile[def])

shell = cmd.exe
CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  =
OBJ  = ./com/Cmpnt.o ./com/GUIDS.o ./com/Registry.o $(RES)
LINKOBJ  = ./com/Cmpnt.o ./com/GUIDS.o ./com/Registry.o $(RES) $(RES)
LIBS =  -L"C:/MinGW/lib" -fmessage-length=0 --no-export-all-symbols --add-stdcall-alias -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -O3 -s
INCS =  -I"c:/MinGW/include" 
CXXINCS =  -I"C:/MinGW/include/c++/3.4.5"  -I"C:/MinGW/include/c++/3.4.5/mingw32"  -I"C:/MinGW/include/c++/3.4.5/backward"  -I"D:/MinGW/include"  -I"./com"
BIN  = ComServer07.dll
CXXFLAGS = $(CXXINCS)-O3   -fmessage-length=0 -Wall
CFLAGS = $(INCS)-DBUILDING_DLL=1 -O3   -fmessage-length=0 -Wall

.PHONY: all all-before all-after clean clean-custom

all: all-before ComServer07.dll all-after


clean: clean-custom
 rm -f $(OBJ) $(BIN)


DLLWRAP=dllwrap.exe
DEFFILE=./com/ComServer07.def
STATICLIB=CMPNT.DLL

$(BIN): $(LINKOBJ)
 $(DLLWRAP) --def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN)

./com/Cmpnt.o: ./com/Cmpnt.cpp
 $(CPP) -c ./com/Cmpnt.cpp -o ./com/Cmpnt.o $(CXXFLAGS)
 
./com/GUIDS.o: ./com/GUIDS.cpp
 $(CPP) -c ./com/GUIDS.cpp -o ./com/GUIDS.o $(CXXFLAGS)
  
./com/Registry.o: ./com/Registry.cpp
 $(CPP) -c ./com/Registry.cpp -o ./com/Registry.o $(CXXFLAGS)  

 

 

 

 

 

 

 

 

 

 

LIBRARY         Cmpnt.dll
DESCRIPTION     'Chapter 7 Example COM Component (c)1996-1997 Dale E. Rogerson'

EXPORTS
                DllGetClassObject   @2 PRIVATE
                DllCanUnloadNow     @3 PRIVATE
                DllRegisterServer   @4 PRIVATE
                DllUnregisterServer @5 PRIVATE

 

 

 

 

%SystemRoot%\System32\regsvr32 /u ComServer07.dll

 

 

%SystemRoot%\System32\regsvr32  ComServer07.dll

你可能感兴趣的:(C++,c,C#,gcc,F#)