From http://www.jwz.org/xscreensaver/xscreensaver-5.38.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     -DSTANDALONE=1 \
10     -DHAVE_ANDROID=1 \
11     -DHAVE_GL=1 \
12     -DHAVE_JWXYZ=1 \
13     -DJWXYZ_GL=1 \
14     -DJWXYZ_IMAGE=1 \
15     -DHAVE_JWZGLES=1 \
16     -DHAVE_XUTF8DRAWSTRING=1 \
17     -DHAVE_GLBINDTEXTURE=1 \
18     -DGL_VERSION_ES_CM_1_0 \
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     hacks/glx/xpm-ximage.c \
56
57 # Some savers occupy more than one source file:
58 LOCAL_SRC_FILES += \
59     hacks/glx/b_draw.c \
60     hacks/glx/b_lockglue.c \
61     hacks/glx/b_sphere.c \
62     hacks/glx/buildlwo.c \
63     hacks/glx/companion_quad.c \
64     hacks/glx/companion_disc.c \
65     hacks/glx/companion_heart.c \
66     hacks/glx/cow_face.c \
67     hacks/glx/cow_hide.c \
68     hacks/glx/cow_hoofs.c \
69     hacks/glx/cow_horns.c \
70     hacks/glx/cow_tail.c \
71     hacks/glx/cow_udder.c \
72     hacks/glx/dolphin.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/robot.c \
80     hacks/glx/robot-wireframe.c \
81     hacks/glx/polyhedra-gl.c \
82     hacks/glx/s1_1.c \
83     hacks/glx/s1_2.c \
84     hacks/glx/s1_3.c \
85     hacks/glx/s1_4.c \
86     hacks/glx/s1_5.c \
87     hacks/glx/s1_6.c \
88     hacks/glx/s1_b.c \
89     hacks/glx/seccam.c \
90     hacks/glx/shark.c \
91     hacks/glx/sonar-sim.c \
92     hacks/glx/sonar-icmp.c \
93     hacks/glx/splitflap_obj.c \
94     hacks/glx/sproingiewrap.c \
95     hacks/glx/stonerview-move.c \
96     hacks/glx/stonerview-osc.c \
97     hacks/glx/stonerview-view.c \
98     hacks/glx/swim.c \
99     hacks/glx/tangram_shapes.c \
100     hacks/glx/teapot.c \
101     hacks/glx/toast.c \
102     hacks/glx/toast2.c \
103     hacks/glx/toaster.c \
104     hacks/glx/toaster_base.c \
105     hacks/glx/toaster_handle.c \
106     hacks/glx/toaster_handle2.c \
107     hacks/glx/toaster_jet.c \
108     hacks/glx/toaster_knob.c \
109     hacks/glx/toaster_slots.c \
110     hacks/glx/toaster_wing.c \
111     hacks/glx/tronbit_idle1.c \
112     hacks/glx/tronbit_idle2.c \
113     hacks/glx/tronbit_no.c \
114     hacks/glx/tronbit_yes.c \
115     hacks/glx/tunnel_draw.c \
116     hacks/glx/whale.c \
117
118 # The source files of the currently active GL hacks:
119 LOCAL_SRC_FILES += $(shell \
120   for f in $$ANDROID_HACKS ; do \
121     if [ "$$f" = "companioncube" ]; then f="companion"; fi ; \
122     if [ -f "../../../hacks/glx/$$f.c" ]; then \
123       echo "hacks/glx/$$f.c" ; \
124     fi ; \
125   done )
126
127 LOCAL_C_INCLUDES := $(SHARED_C_INCLUDES)
128 LOCAL_CFLAGS += $(SHARED_CFLAGS) -DUSE_GL
129
130 include $(BUILD_STATIC_LIBRARY)
131
132 ##############################################################################
133
134 include $(CLEAR_VARS)
135
136 LOCAL_MODULE := xscreensaver
137
138 LOCAL_STATIC_LIBRARIES := xscreensaver-gl
139
140 # The base framework files:
141 LOCAL_SRC_FILES := \
142     jwxyz/jwxyz-android.c \
143     jwxyz/jwxyz-common.c \
144     jwxyz/jwxyz-gl.c \
145     jwxyz/jwxyz-image.c \
146     jwxyz/jwxyz-timers.c \
147     jwxyz/jwzgles.c \
148
149 # Utilities used by the hacks:
150 LOCAL_SRC_FILES += \
151     hacks/analogtv.c \
152     hacks/delaunay.c \
153     hacks/fps.c \
154     hacks/xlockmore.c \
155     hacks/xpm-pixmap.c \
156     utils/async_netdb.c \
157     utils/aligned_malloc.c \
158     utils/colorbars.c \
159     utils/colors.c \
160     utils/erase.c \
161     utils/grabclient.c \
162     utils/hsv.c \
163     utils/logo.c \
164     utils/minixpm.c \
165     utils/pow2.c \
166     utils/resources.c \
167     utils/spline.c \
168     utils/textclient-mobile.c \
169     utils/thread_util.c \
170     utils/usleep.c \
171     utils/utf8wc.c \
172     utils/xft.c \
173     utils/xshm.c \
174     utils/yarandom.c \
175
176 # The source files of the currently active Xlib hacks:
177 LOCAL_SRC_FILES += $(shell \
178   for f in $$ANDROID_HACKS ; do \
179     if [ -f "../../../hacks/$$f.c" ]; then \
180       echo "hacks/$$f.c" ; \
181     fi ; \
182   done )
183
184 # Some savers occupy more than one source file:
185 LOCAL_SRC_FILES += \
186     hacks/apple2-main.c \
187     hacks/asm6502.c \
188     hacks/pacman_ai.c \
189     hacks/pacman_level.c \
190
191 LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lEGL -latomic -landroid
192
193 LOCAL_C_INCLUDES := $(SHARED_C_INCLUDES)
194 LOCAL_CFLAGS += $(SHARED_CFLAGS)
195
196 include $(BUILD_SHARED_LIBRARY)