update plists MACOSX_DEPLOYMENT_TARGET = 10.7.0
[wdl/wdl-ol.git] / WDL / swell / Makefile
blobd821f8e19a38e3e0aa1eafc09939f02357da6fa3
1 # use make
2 # or make NOGDK=1
3 # or make DEBUG=1
4 # etc
6 ARCH := $(shell uname -m)
7 UNAME_S := $(shell uname -s)
9 PKG_CONFIG = pkg-config
11 CFLAGS = -pipe -fvisibility=hidden -fno-math-errno -fPIC -DPIC -Wall -Wshadow -Wno-unused-function -Wno-multichar -Wno-unused-result
13 ifeq ($(UNAME_S),Darwin)
14 CFLAGS += -Wno-unused-private-field -DSWELL_FORCE_GENERIC
15 DLL_EXT=.dylib
16 else
17 DLL_EXT=.so
18 endif
20 ifndef ALLOW_WARNINGS
21 CFLAGS += -Werror
22 endif
23 ifndef DEPRECATED_WARNINGS
24 CFLAGS += -Wno-deprecated-declarations
25 endif
27 ifneq ($(filter arm%,$(ARCH)),)
28 CFLAGS += -fsigned-char -marm
29 endif
32 ifdef DEBUG
33 CFLAGS += -O0 -g -D_DEBUG
34 else
35 CFLAGS += -O2 -DNDEBUG
36 ifneq ($(UNAME_S),Darwin)
37 CFLAGS += -s
38 endif
39 endif
41 LINKEXTRA = -lpthread -ldl
44 EXTRA_OBJS =
49 vpath %.cpp .. ../lice
51 SWELL_OBJS = swell.o swell-ini.o swell-miscdlg-generic.o swell-wnd-generic.o \
52 swell-menu-generic.o swell-kb-generic.o swell-dlg-generic.o \
53 swell-gdi-generic.o swell-misc-generic.o swell-gdi-lice.o \
54 swell-generic-headless.o swell-generic-gdk.o \
55 swell-appstub-generic.o swell-modstub-generic.o
57 LICE_OBJS = lice.o lice_arc.o lice_colorspace.o lice_line.o lice_text.o \
58 lice_textnew.o lice_ico.o lice_bmp.o
60 OBJS = $(SWELL_OBJS)
62 ifndef NOGDK
63 ifdef GDK2
64 CFLAGS += -DSWELL_TARGET_GDK=2 $(shell $(PKG_CONFIG) --cflags gdk-2.0)
65 ifndef PRELOAD_GDK
66 LINKEXTRA += $(shell $(PKG_CONFIG) --libs gdk-2.0)
67 else
68 LINKEXTRA += -lX11 -lXi
69 CFLAGS += -DSWELL_PRELOAD="libgdk-x11-2.0.so.0"
70 endif
71 else
72 CFLAGS += -DSWELL_TARGET_GDK=3 $(shell $(PKG_CONFIG) --cflags gdk-3.0)
73 ifndef PRELOAD_GDK
74 LINKEXTRA += $(shell $(PKG_CONFIG) --libs gdk-3.0)
75 else
76 LINKEXTRA += -lX11 -lXi
77 CFLAGS += -DSWELL_PRELOAD="libgdk-3.so.0"
78 endif
79 endif
80 CFLAGS += -DSWELL_LICE_GDI
81 OBJS += $(LICE_OBJS)
83 ifndef NOFREETYPE
84 CFLAGS += -DSWELL_FREETYPE $(shell freetype-config --cflags)
85 ifndef PRELOAD_GDK
86 LINKEXTRA += $(shell freetype-config --libs)
87 endif
88 endif
89 endif
91 CXXFLAGS = $(CFLAGS)
93 default: libSwell$(DLL_EXT)
95 .PHONY: clean
97 SWELL_HEADERS=swell-dlggen.h swell-gdi-internalpool.h swell-menugen.h swell-types.h swell-functions.h swell-internal.h
99 swell.o: $(SWELL_HEADERS)
100 swell-ini.o: $(SWELL_HEADERS)
101 swell-wnd-generic.o: $(SWELL_HEADERS)
102 swell-dlg-generic.o: $(SWELL_HEADERS)
103 swell-menu-generic.o: $(SWELL_HEADERS)
104 swell-misc-generic.o: $(SWELL_HEADERS)
105 swell-gdi-generic.o: $(SWELL_HEADERS)
106 swell-gdi-lice.o: $(SWELL_HEADERS)
107 swell-kb-generic.o: $(SWELL_HEADERS)
108 swell-miscdlg-generic.o: $(SWELL_HEADERS)
109 swell-modstub-generic.o: $(SWELL_HEADERS)
110 swell-appstub-generic.o: $(SWELL_HEADERS)
112 libSwell$(DLL_EXT): $(OBJS)
113 $(CXX) -shared -o $@ $(CFLAGS) $(LFLAGS) $^ $(LINKEXTRA)
115 test: $(OBJS) test.o
116 $(CXX) -o test $(CFLAGS) $(LFLAGS) $^ $(LINKEXTRA)
118 libSwell.colortheme: swell-gdi-generic.cpp $(SWELL_HEADERS)
119 $(CXX) $(CFLAGS) -o make-theme -DSWELL__MAKE_THEME swell-gdi-generic.cpp -lpthread
120 ./make-theme > libSwell.colortheme
122 clean:
123 -rm $(OBJS) libSwell$(DLL_EXT) make-theme libSwell.colortheme