From http://www.jwz.org/xscreensaver/xscreensaver-5.40.tar.gz
[xscreensaver] / android / xscreensaver / jni / Android.mk
1 LOCAL_PATH := $(call my-dir)/../../..
2
3 # -Wnested-externs would also be here, but for Android unistd.h.
4 SHARED_CFLAGS = \
5     -std=c99 \
6     -Wall \
7     -Wstrict-prototypes \
8     -Wmissing-prototypes \
9     -DGL_GLEXT_PROTOTYPES \
10     -DSTANDALONE=1 \
11     -DHAVE_ANDROID=1 \
12     -DHAVE_GL=1 \
13     -DHAVE_JWXYZ=1 \
14     -DJWXYZ_GL=1 \
15     -DJWXYZ_IMAGE=1 \
16     -DHAVE_JWZGLES=1 \
17     -DHAVE_XUTF8DRAWSTRING=1 \
18     -DHAVE_GLBINDTEXTURE=1 \
19     -DHAVE_UNISTD_H=1 \
20     -DHAVE_INTTYPES_H=1 \
21     -DHAVE_UNAME=1 \
22     -DHAVE_UTIL_H=1 \
23     -DGETTIMEOFDAY_TWO_ARGS=1 \
24     -DHAVE_ICMP=1 \
25     -DHAVE_PTHREAD=1 \
26
27 SHARED_C_INCLUDES = \
28     $(LOCAL_PATH) \
29     $(LOCAL_PATH)/android \
30     $(LOCAL_PATH)/utils \
31     $(LOCAL_PATH)/jwxyz \
32     $(LOCAL_PATH)/hacks \
33     $(LOCAL_PATH)/hacks/glx \
34
35 include $(CLEAR_VARS)
36
37 LOCAL_MODULE := xscreensaver-gl
38
39 LOCAL_SRC_FILES := \
40     android/screenhack-android.c \
41     hacks/glx/dropshadow.c \
42     hacks/glx/chessmodels.c \
43     hacks/glx/fps-gl.c \
44     hacks/glx/gltrackball.c \
45     hacks/glx/glut_stroke.c \
46     hacks/glx/glut_swidth.c \
47     hacks/glx/grab-ximage.c \
48     hacks/glx/marching.c \
49     hacks/glx/normals.c \
50     hacks/glx/rotator.c \
51     hacks/glx/sphere.c \
52     hacks/glx/texfont.c \
53     hacks/glx/trackball.c \
54     hacks/glx/tube.c \
55
56 # Some savers occupy more than one source file:
57 LOCAL_SRC_FILES += \
58     hacks/glx/b_draw.c \
59     hacks/glx/b_lockglue.c \
60     hacks/glx/b_sphere.c \
61     hacks/glx/buildlwo.c \
62     hacks/glx/companion_quad.c \
63     hacks/glx/companion_disc.c \
64     hacks/glx/companion_heart.c \
65     hacks/glx/cow_face.c \
66     hacks/glx/cow_hide.c \
67     hacks/glx/cow_hoofs.c \
68     hacks/glx/cow_horns.c \
69     hacks/glx/cow_tail.c \
70     hacks/glx/cow_udder.c \
71     hacks/glx/dolphin.c \
72     hacks/glx/dymaxionmap-coords.c \
73     hacks/glx/gllist.c \
74     hacks/glx/glschool_alg.c \
75     hacks/glx/glschool_gl.c \
76     hacks/glx/involute.c \
77     hacks/glx/lament_model.c \
78     hacks/glx/pipeobjs.c \
79     hacks/glx/quickhull.c \
80     hacks/glx/robot.c \
81     hacks/glx/robot-wireframe.c \
82     hacks/glx/polyhedra-gl.c \
83     hacks/glx/s1_1.c \
84     hacks/glx/s1_2.c \
85     hacks/glx/s1_3.c \
86     hacks/glx/s1_4.c \
87     hacks/glx/s1_5.c \
88     hacks/glx/s1_6.c \
89     hacks/glx/s1_b.c \
90     hacks/glx/seccam.c \
91     hacks/glx/shark.c \
92     hacks/glx/ships.c \
93     hacks/glx/sonar-sim.c \
94     hacks/glx/sonar-icmp.c \
95     hacks/glx/splitflap_obj.c \
96     hacks/glx/sproingiewrap.c \
97     hacks/glx/stonerview-move.c \
98     hacks/glx/stonerview-osc.c \
99     hacks/glx/stonerview-view.c \
100     hacks/glx/swim.c \
101     hacks/glx/tangram_shapes.c \
102     hacks/glx/teapot.c \
103     hacks/glx/toast.c \
104     hacks/glx/toast2.c \
105     hacks/glx/toaster.c \
106     hacks/glx/toaster_base.c \
107     hacks/glx/toaster_handle.c \
108     hacks/glx/toaster_handle2.c \
109     hacks/glx/toaster_jet.c \
110     hacks/glx/toaster_knob.c \
111     hacks/glx/toaster_slots.c \
112     hacks/glx/toaster_wing.c \
113     hacks/glx/tronbit_idle1.c \
114     hacks/glx/tronbit_idle2.c \
115     hacks/glx/tronbit_no.c \
116     hacks/glx/tronbit_yes.c \
117     hacks/glx/tunnel_draw.c \
118     hacks/glx/whale.c \
119
120 # The source files of the currently active GL hacks:
121 LOCAL_SRC_FILES += $(shell \
122   for f in $$ANDROID_HACKS ; do \
123     if [ "$$f" = "companioncube" ]; then f="companion"; fi ; \
124     if [ -f "../../../hacks/glx/$$f.c" ]; then \
125       echo "hacks/glx/$$f.c" ; \
126     fi ; \
127   done )
128
129 LOCAL_C_INCLUDES := $(SHARED_C_INCLUDES)
130 LOCAL_CFLAGS += $(SHARED_CFLAGS) -DUSE_GL
131
132 include $(BUILD_STATIC_LIBRARY)
133
134 ##############################################################################
135
136 include $(CLEAR_VARS)
137
138 LOCAL_MODULE := xscreensaver
139
140 LOCAL_STATIC_LIBRARIES := xscreensaver-gl
141
142 # The base framework files:
143 LOCAL_SRC_FILES := \
144     jwxyz/jwxyz-android.c \
145     jwxyz/jwxyz-common.c \
146     jwxyz/jwxyz-gl.c \
147     jwxyz/jwxyz-image.c \
148     jwxyz/jwxyz-timers.c \
149     jwxyz/jwzgles.c \
150
151 # Utilities used by the hacks:
152 LOCAL_SRC_FILES += \
153     hacks/analogtv.c \
154     hacks/delaunay.c \
155     hacks/fps.c \
156     hacks/xlockmore.c \
157     hacks/ximage-loader.c \
158     utils/async_netdb.c \
159     utils/aligned_malloc.c \
160     utils/colorbars.c \
161     utils/colors.c \
162     utils/erase.c \
163     utils/font-retry.c \
164     utils/grabclient.c \
165     utils/hsv.c \
166     utils/logo.c \
167     utils/minixpm.c \
168     utils/pow2.c \
169     utils/resources.c \
170     utils/spline.c \
171     utils/textclient-mobile.c \
172     utils/thread_util.c \
173     utils/usleep.c \
174     utils/utf8wc.c \
175     utils/xft.c \
176     utils/xshm.c \
177     utils/yarandom.c \
178
179 # The source files of the currently active Xlib hacks:
180 LOCAL_SRC_FILES += $(shell \
181   for f in $$ANDROID_HACKS ; do \
182     if [ -f "../../../hacks/$$f.c" ]; then \
183       echo "hacks/$$f.c" ; \
184     fi ; \
185   done )
186
187 # Some savers occupy more than one source file:
188 LOCAL_SRC_FILES += \
189     hacks/apple2-main.c \
190     hacks/asm6502.c \
191     hacks/pacman_ai.c \
192     hacks/pacman_level.c \
193
194 LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lEGL -latomic -landroid -ljnigraphics
195
196 LOCAL_C_INCLUDES := $(SHARED_C_INCLUDES)
197 LOCAL_CFLAGS += $(SHARED_CFLAGS)
198
199 include $(BUILD_SHARED_LIBRARY)