1 2SRCDIR = ..\libmpdec 3LIBSTATIC = libmpdec-4.0.0.lib 4LIBSHARED = libmpdec-4.0.0.dll 5LIBIMPORT = libmpdec-4.0.0.dll.lib 6 7!if "$(DEBUG)" == "1" 8OPT = /MTd /Od /Zi /EHsc 9OPT_SHARED = /MDd /Od /Zi /EHsc 10!else 11OPT = /MT /O2 /GS /EHsc /DNDEBUG 12OPT_SHARED = /MD /O2 /GS /EHsc /DNDEBUG 13!endif 14 15!if "$(CC)" == "clang-cl" 16WARN = /W4 /wd4200 /wd4204 /wd4221 -Wno-undefined-inline /D_CRT_SECURE_NO_WARNINGS 17!else 18WARN = /W4 /wd4200 /wd4204 /wd4221 /D_CRT_SECURE_NO_WARNINGS 19!endif 20 21MPD_CFLAGS = $(WARN) /nologo $(OPT) 22MPD_CFLAGS_SHARED = $(WARN) /nologo $(OPT_SHARED) 23 24 25default: runtest runtest_shared copy_dll 26 27 28runtest:\ 29Makefile runtest.c test.c $(SRCDIR)\io.h $(SRCDIR)\mpdecimal.h $(SRCDIR)\mpalloc.h test.h vctest.h \ 30$(SRCDIR)\$(LIBSTATIC) 31 $(CC) -I$(SRCDIR) $(MPD_CFLAGS) /Fe:runtest runtest.c test.c $(SRCDIR)\$(LIBSTATIC) 32 33runtest_shared:\ 34Makefile runtest.c test.c $(SRCDIR)/io.h $(SRCDIR)/mpdecimal.h $(SRCDIR)/mpalloc.h test.h vctest.h \ 35$(SRCDIR)/$(LIBSHARED) $(SRCDIR)/$(LIBIMPORT) 36 $(CC) -I$(SRCDIR) $(MPD_CFLAGS_SHARED) /Fe:runtest_shared runtest.c test.c $(SRCDIR)\$(LIBIMPORT) 37 38FORCE: 39 40copy_dll: 41 copy /y $(SRCDIR)\$(LIBSHARED) . 42 43clean: FORCE 44 -@if exist *.obj del *.obj 45 -@if exist *.dll del *.dll 46 -@if exist *.exp del *.exp 47 -@if exist *.lib del *.lib 48 -@if exist *.ilk del *.ilk 49 -@if exist *.pdb del *.pdb 50 -@if exist *.pgc del *.pgc 51 -@if exist *.pgd del *.pgd 52 -@if exist *.manifest del *.manifest 53 -@if exist *.exe del *.exe 54 55distclean: FORCE 56 nmake clean 57 -@if exist dectest.zip del dectest.zip 58 -@if exist testdata rd /q /s testdata 59 -@if exist Makefile del Makefile 60