summaryrefslogtreecommitdiff
path: root/Makefile.mingw32
blob: 41fdcbaaf9612d16904f883d07dcdf3de2691c5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CC = i586-mingw32msvc-gcc
LD = i586-mingw32msvc-gcc
AR = i586-mingw32msvc-ar rcs

CPPFLAGS = -g -Wall -Werror -D_FILE_OFFSET_BITS=64 -I. -I ../gnuwin32/include
LDFLAGS = -g -L../gnuwin32/lib

SOURCE_LIST = \
MPQCryptography.c \
errors.c \
extract.c \
lookupa.c \
hashtab.c \
recycle.c \
mpq-bios.c \
mpq-errors.c \
mpq-file.c \
mpq-fs.c \
mpq-misc.c \


TARGET = mpqlib.dll


OBJ_LIST = $(addsuffix .o, $(notdir $(basename $(SOURCE_LIST))))
DEP_LIST = $(addsuffix .dep, $(notdir $(basename $(SOURCE_LIST))))

all: dep $(TARGET)

$(TARGET): $(OBJ_LIST)
	$(LD) -shared -Wl,--output-def=mpqlib.def -Wl,--out-implib=mpqlib.a -o mpqlib.dll $(OBJ_LIST) -g -fexceptions -Wl,--enable-auto-image-base -Wl,--export-dynamic --export-all-symbols -Wl,--enable-auto-import -fexceptions -lz.dll $(LDFLAGS)

test-it.exe: $(TARGET) test-it.o
	$(LD) -o test-it.exe test-it.o $(TARGET) $(LDFLAGS)

clean:
	rm -f *.o *.dep $(TARGET) test-it.exe *.dll *.a

dep: $(DEP_LIST)

%.dep : %.c
	$(CC) $(CPPFLAGS) -M -MF $@ $<

-include $(DEP_LIST)