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