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 CFLAGS
+= -DSWELL_TARGET_GDK
=3 $(shell $(PKG_CONFIG
) --cflags gdk-3.0
)
74 LINKEXTRA
+= $(shell $(PKG_CONFIG
) --libs gdk-3.0
)
76 LINKEXTRA
+= -lX11
-lXi
77 CFLAGS
+= -DSWELL_PRELOAD
="libgdk-3.so.0"
80 CFLAGS
+= -DSWELL_LICE_GDI
84 CFLAGS
+= -DSWELL_FREETYPE
$(shell freetype-config
--cflags)
86 LINKEXTRA
+= $(shell freetype-config
--libs
)
93 default
: libSwell
$(DLL_EXT
)
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
)
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
123 -rm $(OBJS
) libSwell
$(DLL_EXT
) make-theme libSwell.colortheme