| 1 |
# Make liblouis.dll and liblouis.lib |
| 2 |
|
| 3 |
# Do not edit this file. Make changes in configure.mk |
| 4 |
|
| 5 |
!include configure.mk |
| 6 |
|
| 7 |
CC = clang-cl |
| 8 |
|
| 9 |
!if "$(ARCH)" == "x86" |
| 10 |
CLANG_TARGET = i686-pc-windows-msvc |
| 11 |
!elseif "$(ARCH)" == "arm64" |
| 12 |
CLANG_TARGET = aarch64-pc-windows-msvc |
| 13 |
!elseif "$(ARCH)" == "arm64ec" |
| 14 |
CLANG_TARGET = arm64ec-pc-windows-msvc |
| 15 |
!else |
| 16 |
CLANG_TARGET = x86_64-pc-windows-msvc |
| 17 |
!endif |
| 18 |
|
| 19 |
CFLAGS = /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING |
| 20 |
CFLAGS = $(CFLAGS) --target=$(CLANG_TARGET) |
| 21 |
# The Visual C++ C Runtime deprecates several standard library functions in |
| 22 |
# preference for _s variants that are specific to Visual C++. This removes |
| 23 |
# those deprecation warnings. |
| 24 |
CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_WARNINGS |
| 25 |
# The Visual C++ C Runtime deprecates standard POSIX APIs that conflict with |
| 26 |
# reserved ISO C names (like strdup) in favour of non-portable conforming |
| 27 |
# variants that start with an '_'. This removes those deprecation warnings. */ |
| 28 |
CFLAGS = $(CFLAGS) /D_CRT_NONSTDC_NO_DEPRECATE |
| 29 |
|
| 30 |
!if "$(UCS)" == "2" |
| 31 |
WIDECHAR_TYPE = unsigned short int |
| 32 |
!else |
| 33 |
WIDECHAR_TYPE = unsigned int |
| 34 |
!endif |
| 35 |
|
| 36 |
DLLFLAGS = /dll /nologo |
| 37 |
LIBFLAGS = /nologo |
| 38 |
|
| 39 |
# ARM64EC objects carry the x64 machine type, so the linker and librarian |
| 40 |
# only produce ARM64EC output when told to explicitly. |
| 41 |
!if "$(ARCH)" == "arm64ec" |
| 42 |
DLLFLAGS = $(DLLFLAGS) /MACHINE:ARM64EC |
| 43 |
LIBFLAGS = $(LIBFLAGS) /MACHINE:ARM64EC |
| 44 |
!endif |
| 45 |
|
| 46 |
HEADERS = $(SRCDIR)\internal.h $(SRCDIR)\liblouis.h \ |
| 47 |
include\config.h |
| 48 |
OBJ = commonTranslationFunctions.obj compileTranslationTable.obj \ |
| 49 |
logging.obj lou_backTranslateString.obj lou_translateString.obj \ |
| 50 |
metadata.obj pattern.obj utils.obj |
| 51 |
|
| 52 |
all: liblouis.lib |
| 53 |
link $(DLLFLAGS) /OUT:liblouis.dll $(OBJ) |
| 54 |
|
| 55 |
clean: |
| 56 |
clean.bat |
| 57 |
|
| 58 |
liblouis.lib: $(OBJ) |
| 59 |
lib $(LIBFLAGS) $(OBJ) /out:liblouis.lib |
| 60 |
|
| 61 |
$(SRCDIR)\liblouis.h: $(SRCDIR)\liblouis.h.in |
| 62 |
PowerShell -ExecutionPolicy RemoteSigned \ |
| 63 |
-File $(UTILSDIR)\find-replace.ps1 \ |
| 64 |
-InputFile $(SRCDIR)\liblouis.h.in -OutputFile $(SRCDIR)\liblouis.h \ |
| 65 |
-Str1 @WIDECHAR_TYPE@ -Str2 "$(WIDECHAR_TYPE)" |
| 66 |
|
| 67 |
commonTranslationFunctions.obj: $(SRCDIR)\commonTranslationFunctions.c \ |
| 68 |
$(HEADERS) |
| 69 |
$(CC) $(CFLAGS) $(SRCDIR)\commonTranslationFunctions.c |
| 70 |
|
| 71 |
compileTranslationTable.obj: $(SRCDIR)\compileTranslationTable.c \ |
| 72 |
$(HEADERS) |
| 73 |
$(CC) $(CFLAGS) $(SRCDIR)\compileTranslationTable.c |
| 74 |
|
| 75 |
logging.obj: $(SRCDIR)\logging.c $(HEADERS) |
| 76 |
$(CC) $(CFLAGS) $(SRCDIR)\logging.c |
| 77 |
|
| 78 |
lou_backTranslateString.obj: $(SRCDIR)\lou_backTranslateString.c \ |
| 79 |
$(HEADERS) |
| 80 |
$(CC) $(CFLAGS) $(SRCDIR)\lou_backTranslateString.c |
| 81 |
|
| 82 |
lou_translateString.obj: $(SRCDIR)\lou_translateString.c $(HEADERS) |
| 83 |
$(CC) $(CFLAGS) $(SRCDIR)\lou_translateString.c |
| 84 |
|
| 85 |
metadata.obj: $(SRCDIR)\metadata.c $(HEADERS) |
| 86 |
$(CC) $(CFLAGS) $(SRCDIR)\metadata.c |
| 87 |
|
| 88 |
pattern.obj: $(SRCDIR)\pattern.c $(HEADERS) |
| 89 |
$(CC) $(CFLAGS) $(SRCDIR)\pattern.c |
| 90 |
|
| 91 |
utils.obj: $(SRCDIR)\utils.c $(HEADERS) |
| 92 |
$(CC) $(CFLAGS) $(SRCDIR)\utils.c |