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
23 ifndef DEPRECATED_WARNINGS
24 CFLAGS
+= -Wno-deprecated-declarations
27 ifneq ($(filter arm
%,$(ARCH
)),)
28 CFLAGS
+= -fsigned-char
-marm
33 CFLAGS
+= -O0
-g
-D_DEBUG
35 CFLAGS
+= -O2
-DNDEBUG
36 ifneq ($(UNAME_S
),Darwin
)
41 LINKEXTRA
= -lpthread
-ldl
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
64 CFLAGS
+= -DSWELL_TARGET_GDK
=2 $(shell $(PKG_CONFIG
) --cflags gdk-2.0
)
66 LINKEXTRA
+= $(shell $(PKG_CONFIG
) --libs gdk-2.0
)
68 LINKEXTRA
+= -lX11
-lXi
69 CFLAGS
+= -DSWELL_PRELOAD
="libgdk-x11-2.0.so.0"
72 ifdef SWELL_SUPPORT_GTK
73 CFLAGS
+= -DSWELL_TARGET_GDK
=3 $(shell $(PKG_CONFIG
) --cflags gtk
+-3.0) -DSWELL_SUPPORT_GTK
75 CFLAGS
+= -DSWELL_TARGET_GDK
=3 $(shell $(PKG_CONFIG
) --cflags gdk-3.0
)
78 ifdef SWELL_SUPPORT_GTK
79 LINKEXTRA
+= $(shell $(PKG_CONFIG
) --libs gtk
+-3.0)
81 LINKEXTRA
+= $(shell $(PKG_CONFIG
) --libs gdk-3.0
)
84 LINKEXTRA
+= -lX11
-lXi
85 ifdef SWELL_SUPPORT_GTK
86 CFLAGS
+= -DSWELL_PRELOAD
="libgtk+-3.so.0"
88 CFLAGS
+= -DSWELL_PRELOAD
="libgdk-3.so.0"
92 CFLAGS
+= -DSWELL_LICE_GDI
96 CFLAGS
+= -DSWELL_FREETYPE
$(shell freetype-config
--cflags)
98 LINKEXTRA
+= $(shell freetype-config
--libs
)
105 default
: libSwell
$(DLL_EXT
)
109 SWELL_HEADERS
=swell-dlggen.h swell-gdi-internalpool.h swell-menugen.h swell-types.h swell-functions.h swell-internal.h
111 swell.o
: $(SWELL_HEADERS
)
112 swell-ini.o
: $(SWELL_HEADERS
)
113 swell-wnd-generic.o
: $(SWELL_HEADERS
)
114 swell-dlg-generic.o
: $(SWELL_HEADERS
)
115 swell-menu-generic.o
: $(SWELL_HEADERS
)
116 swell-misc-generic.o
: $(SWELL_HEADERS
)
117 swell-gdi-generic.o
: $(SWELL_HEADERS
)
118 swell-gdi-lice.o
: $(SWELL_HEADERS
)
119 swell-kb-generic.o
: $(SWELL_HEADERS
)
120 swell-miscdlg-generic.o
: $(SWELL_HEADERS
)
121 swell-modstub-generic.o
: $(SWELL_HEADERS
)
122 swell-appstub-generic.o
: $(SWELL_HEADERS
)
124 libSwell
$(DLL_EXT
): $(OBJS
)
125 $(CXX
) -shared
-o
$@
$(CFLAGS
) $(LFLAGS
) $^
$(LINKEXTRA
)
128 $(CXX
) -o
test $(CFLAGS
) $(LFLAGS
) $^
$(LINKEXTRA
)
130 libSwell.colortheme
: swell-gdi-generic.
cpp $(SWELL_HEADERS
)
131 $(CXX
) $(CFLAGS
) -o make-theme
-DSWELL__MAKE_THEME swell-gdi-generic.
cpp -lpthread
132 .
/make-theme
> libSwell.colortheme
135 -rm $(OBJS
) libSwell
$(DLL_EXT
) make-theme libSwell.colortheme