| ODIR = windows |
| WIN64 = no |
| ifeq ($(PROCESSOR_ARCHITECTURE), AMD64) |
| WIN64 = yes |
| else |
| ifeq ($(PROCESSOR_ARCHITEW6432), AMD64) |
| WIN64 = yes |
| endif |
| endif |
| ifeq ($(WIN64), yes) |
| ODIR = windows64 |
| endif |
| |
| _DUMMY := $(shell mkdir -p $(ODIR)) |
| |
| VERSION = 1.0.0 |
| |
| CC = "cl" -nologo |
| CXX = "cl" -EHsc -nologo |
| AR = "link" -lib -nologo |
| LINK = "link" -nologo |
| ifeq ($(DEBUG), yes) |
| LINK = "link" -nologo -debug |
| endif |
| ifeq ($(NASM),) |
| NASM = nasm |
| endif |
| |
| CFLAGS = -W3 -wd4996 -Iwin -I. -DBMP_SUPPORTED -DGIF_SUPPORTED \ |
| -DPPM_SUPPORTED -DTARGA_SUPPORTED |
| ifeq ($(WIN64), yes) |
| NAFLAGS = -fwin64 -DWIN64 -DMSVC -D__x86_64__ -Iwin/ |
| else |
| NAFLAGS = -fwin32 -DWIN32 -DMSVC -Iwin/ |
| endif |
| ifeq ($(DEBUG), yes) |
| CFLAGS := $(CFLAGS) -Od -Zi |
| NAFLAGS := $(NAFLAGS) -g |
| LIBCDLL = -MDd |
| LIBCSTATIC = -MTd |
| else |
| CFLAGS := $(CFLAGS) -O2 |
| LIBCDLL = -MD |
| LIBCSTATIC = -MT |
| endif |
| |
| WITH_SIMD = yes |
| |
| ifeq ($(WITH_SIMD), yes) |
| CFLAGS := $(CFLAGS) -DWITH_SIMD |
| endif |
| |
| |
| $(ODIR)/%.obj: %.c |
| $(CC) $(CFLAGS) $(LIBCDLL) -c $< -Fo$@ |
| |
| $(ODIR)/%-static.obj: %.c |
| $(CC) $(CFLAGS) $(LIBCSTATIC) -c $< -Fo$@ |
| |
| $(ODIR)/%.obj: %.cxx |
| $(CXX) $(CXXFLAGS) $(LIBCSTATIC) -c $< -Fo$@ |
| |
| $(ODIR)/%.obj: %.asm |
| $(NASM) $(NAFLAGS) -Isimd/ -o $@ $< |
| |
| $(ODIR)/%.lib: $(ODIR)/%.obj |
| $(AR) -out:$@ $< |