test/Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Sun, 21 Jul 2013 12:47:47 -0700
changeset 7495 c4ba5e5c2765
parent 7280 d1681bbd274a
child 7529 3f571ec09593
permissions -rw-r--r--
Fixed bug 1973 - test/Makefile.in fails on Mac OS X with X11 enabled...

Ryan C. Gordon

If you have the X11 SDK installed on Mac OS X, you'll build with X11 support, but the Makefile doesn't build anything but the Cocoa testnative code for Mac OS X, which is fine, but then testnative fails to link because testnative.h enables the X11 support based on the SDL config header.

Building the testnativex11.c code on Mac OS X doesn't work because you need to explicitly link with "-L/usr/X11/lib -lX11" if this code is enabled, but you can't link with that by default because the X11 SDK might be missing.

So this needs a little configure magic to do the right thing (or forcibly disabling X11 support on Mac OS X in testnative.h).
     1 # Makefile to build the SDL tests
     2 
     3 srcdir  = @srcdir@
     4 
     5 CC      = @CC@
     6 EXE	= @EXE@
     7 CFLAGS  = @CFLAGS@
     8 LIBS	= @LIBS@
     9 
    10 TARGETS = \
    11 	checkkeys$(EXE) \
    12 	loopwave$(EXE) \
    13 	testaudioinfo$(EXE) \
    14 	testautomation$(EXE) \
    15 	testdraw2$(EXE) \
    16 	testerror$(EXE) \
    17 	testfile$(EXE) \
    18 	testgamecontroller$(EXE) \
    19 	testgesture$(EXE) \
    20 	testgl2$(EXE) \
    21 	testgles$(EXE) \
    22 	testhaptic$(EXE) \
    23 	testrumble$(EXE) \
    24 	testthread$(EXE) \
    25 	testiconv$(EXE) \
    26 	testime$(EXE) \
    27 	testintersections$(EXE) \
    28 	testrelative$(EXE) \
    29 	testjoystick$(EXE) \
    30 	testkeys$(EXE) \
    31 	testloadso$(EXE) \
    32 	testlock$(EXE) \
    33 	testmultiaudio$(EXE) \
    34 	testnative$(EXE) \
    35 	testoverlay2$(EXE) \
    36 	testplatform$(EXE) \
    37 	testpower$(EXE) \
    38 	testrendertarget$(EXE) \
    39 	testresample$(EXE) \
    40 	testscale$(EXE) \
    41 	testsem$(EXE) \
    42 	testshader$(EXE) \
    43 	testshape$(EXE) \
    44 	testsprite2$(EXE) \
    45 	testspriteminimal$(EXE) \
    46 	teststreaming$(EXE) \
    47 	testtimer$(EXE) \
    48 	testver$(EXE) \
    49 	testwm2$(EXE) \
    50 	torturethread$(EXE) \
    51 	testrendercopyex$(EXE) \
    52 	testmessage$(EXE) \
    53 
    54 all: Makefile $(TARGETS)
    55 
    56 Makefile: $(srcdir)/Makefile.in
    57 	$(SHELL) config.status $@
    58 
    59 checkkeys$(EXE): $(srcdir)/checkkeys.c
    60 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    61 
    62 loopwave$(EXE): $(srcdir)/loopwave.c
    63 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    64 
    65 testresample$(EXE): $(srcdir)/testresample.c
    66 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    67 
    68 testaudioinfo$(EXE): $(srcdir)/testaudioinfo.c
    69 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    70 
    71 testautomation$(EXE): $(srcdir)/testautomation.c \
    72 		      $(srcdir)/testautomation_audio.c \
    73 		      $(srcdir)/testautomation_clipboard.c \
    74 		      $(srcdir)/testautomation_events.c \
    75 		      $(srcdir)/testautomation_keyboard.c \
    76 		      $(srcdir)/testautomation_main.c \
    77 		      $(srcdir)/testautomation_mouse.c \
    78 		      $(srcdir)/testautomation_pixels.c \
    79 		      $(srcdir)/testautomation_platform.c \
    80 		      $(srcdir)/testautomation_rect.c \
    81 		      $(srcdir)/testautomation_render.c \
    82 		      $(srcdir)/testautomation_rwops.c \
    83 		      $(srcdir)/testautomation_sdltest.c \
    84 		      $(srcdir)/testautomation_stdlib.c \
    85 		      $(srcdir)/testautomation_surface.c \
    86 		      $(srcdir)/testautomation_syswm.c \
    87 		      $(srcdir)/testautomation_timer.c \
    88 		      $(srcdir)/testautomation_video.c
    89 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) 
    90 
    91 testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
    92 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    93 
    94 testatomic$(EXE): $(srcdir)/testatomic.c
    95 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    96 
    97 testintersections$(EXE): $(srcdir)/testintersections.c
    98 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
    99 
   100 testrelative$(EXE): $(srcdir)/testrelative.c
   101 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   102 
   103 testdraw2$(EXE): $(srcdir)/testdraw2.c
   104 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   105 
   106 testerror$(EXE): $(srcdir)/testerror.c
   107 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   108 
   109 testfile$(EXE): $(srcdir)/testfile.c
   110 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   111 
   112 testgamecontroller$(EXE): $(srcdir)/testgamecontroller.c
   113 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   114  
   115 testgesture$(EXE): $(srcdir)/testgesture.c
   116 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
   117  
   118 testgl2$(EXE): $(srcdir)/testgl2.c
   119 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
   120 
   121 testgles$(EXE): $(srcdir)/testgles.c
   122 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
   123 
   124 testhaptic$(EXE): $(srcdir)/testhaptic.c
   125 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   126 
   127 testrumble$(EXE): $(srcdir)/testrumble.c
   128 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   129 
   130 testthread$(EXE): $(srcdir)/testthread.c
   131 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   132 
   133 testiconv$(EXE): $(srcdir)/testiconv.c
   134 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   135 
   136 testime$(EXE): $(srcdir)/testime.c
   137 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @SDL_TTF_LIB@
   138 
   139 testjoystick$(EXE): $(srcdir)/testjoystick.c
   140 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   141 
   142 testkeys$(EXE): $(srcdir)/testkeys.c
   143 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   144 
   145 testloadso$(EXE): $(srcdir)/testloadso.c
   146 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   147 
   148 testlock$(EXE): $(srcdir)/testlock.c
   149 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   150 
   151 ifeq (@ISMACOSX@,true)
   152 testnative$(EXE): $(srcdir)/testnative.c \
   153 			$(srcdir)/testnativecocoa.m \
   154 			$(srcdir)/testnativex11.c
   155 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) -framework Cocoa @XLIB@
   156 endif
   157 
   158 ifeq (@ISWINDOWS@,true)
   159 testnative$(EXE): $(srcdir)/testnative.c \
   160 			$(srcdir)/testnativew32.c
   161 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   162 endif
   163 
   164 ifeq (@ISUNIX@,true)
   165 testnative$(EXE): $(srcdir)/testnative.c \
   166 			$(srcdir)/testnativex11.c
   167 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@
   168 endif
   169 
   170 testoverlay2$(EXE): $(srcdir)/testoverlay2.c
   171 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   172 
   173 testplatform$(EXE): $(srcdir)/testplatform.c
   174 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   175 
   176 testpower$(EXE): $(srcdir)/testpower.c
   177 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   178 
   179 testrendertarget$(EXE): $(srcdir)/testrendertarget.c
   180 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   181 
   182 testscale$(EXE): $(srcdir)/testscale.c
   183 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   184 
   185 testsem$(EXE): $(srcdir)/testsem.c
   186 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   187 
   188 testshader$(EXE): $(srcdir)/testshader.c
   189 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
   190 
   191 testshape$(EXE): $(srcdir)/testshape.c
   192 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   193 
   194 testsprite2$(EXE): $(srcdir)/testsprite2.c
   195 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   196 
   197 testspriteminimal$(EXE): $(srcdir)/testspriteminimal.c
   198 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
   199 
   200 teststreaming$(EXE): $(srcdir)/teststreaming.c
   201 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
   202 
   203 testtimer$(EXE): $(srcdir)/testtimer.c
   204 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   205 
   206 testver$(EXE): $(srcdir)/testver.c
   207 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   208 
   209 testwm2$(EXE): $(srcdir)/testwm2.c
   210 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   211 
   212 torturethread$(EXE): $(srcdir)/torturethread.c
   213 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   214 
   215 testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c
   216 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
   217 
   218 testmessage$(EXE): $(srcdir)/testmessage.c
   219 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
   220 
   221 clean:
   222 	rm -f $(TARGETS)
   223 
   224 distclean: clean
   225 	rm -f Makefile
   226 	rm -f config.status config.cache config.log
   227 	rm -rf $(srcdir)/autom4te*