-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.cygwin
74 lines (53 loc) · 1.45 KB
/
Makefile.cygwin
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Cygwin makefile for FreeImage
# This file can be generated by ./gensrclist.sh
include Makefile.srcs
# General configuration variables:
CC = gcc
CXX = g++
AR = ar
INSTALLDIR = /usr
# Converts cr/lf to just lf
DOS2UNIX = dos2unix
COMPILERFLAGS = -O3 -DNO_LCMS
LIBRARIES = -lstdc++
MODULES = $(SRCS:.c=.o)
MODULES := $(MODULES:.cpp=.o)
CFLAGS = $(COMPILERFLAGS) $(INCLUDE)
CXXFLAGS = $(COMPILERFLAGS) -Wno-ctor-dtor-privacy $(INCLUDE)
TARGET = freeimage
STATICLIB = lib$(TARGET).a
SHAREDLIB = cyg$(TARGET)-$(VER_MAJOR).$(VER_MINOR).dll
LIBNAME = lib$(TARGET).dll.a
HEADER = Source/FreeImage.h
default: all
all: dist
dist: FreeImage
mkdir -p Dist
cp *.a Dist/
cp *.dll Dist/
cp *.dll.a Dist/
cp $(HEADER) Dist/
dos2unix:
@$(DOS2UNIX) $(SRCS) $(INCLS)
FreeImage: $(STATICLIB) $(SHAREDLIB)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $@
$(STATICLIB): $(MODULES)
$(AR) r $@ $(MODULES)
$(SHAREDLIB): $(MODULES)
$(CC) -s -shared -o $@ \
-Wl,--out-implib=$(LIBNAME) \
-Wl,--export-all-symbols \
-Wl,--enable-auto-import \
-Wl,--enable-auto-image-base \
-Wl,--whole-archive $(STATICLIB) \
-Wl,--no-whole-archive $(LIBRARIES)
install:
install -m 644 $(STATICLIB) $(INSTALLDIR)/lib
install -m 644 $(LIBNAME) $(INSTALLDIR)/lib
install -m 755 $(SHAREDLIB) $(INSTALLDIR)/bin
install -m 644 $(HEADER) $(INSTALLDIR)/include
clean:
rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)