Makefile.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 08 Oct 2009 09:14:31 +0000
changeset 3355 3c9e6f2f3c58
parent 3352 6dc250ebdd80
child 3416 3d50171ac879
permissions -rw-r--r--
Merged r4974:4975 from branches/SDL-1.2: sdl.pc removal on make uninstall.

Fixes Bugzilla #813 for the 1.3 branch.
slouken@1362
     1
# Makefile to build and install the SDL library
slouken@1362
     2
slouken@1362
     3
top_builddir = .
slouken@1362
     4
srcdir  = @srcdir@
slouken@1362
     5
objects = build
slouken@1362
     6
prefix = @prefix@
slouken@1362
     7
exec_prefix = @exec_prefix@
slouken@2156
     8
bindir	= @bindir@
slouken@2156
     9
libdir  = @libdir@
slouken@2156
    10
includedir = @includedir@
slouken@2156
    11
datarootdir = @datarootdir@
slouken@2156
    12
datadir	= @datadir@
slouken@1391
    13
auxdir	= @ac_aux_dir@
slouken@1362
    14
distpath = $(srcdir)/..
slouken@1362
    15
distdir = SDL-@SDL_VERSION@
slouken@1362
    16
distfile = $(distdir).tar.gz
slouken@1362
    17
slouken@1380
    18
@SET_MAKE@
slouken@1362
    19
SHELL	= @SHELL@
slouken@1362
    20
CC      = @CC@
slouken@1362
    21
INCLUDE = @INCLUDE@
slouken@1362
    22
CFLAGS  = @BUILD_CFLAGS@
slouken@1521
    23
EXTRA_CFLAGS = @EXTRA_CFLAGS@
slouken@1393
    24
LDFLAGS = @BUILD_LDFLAGS@
slouken@1521
    25
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
slouken@1362
    26
LIBTOOL = @LIBTOOL@
slouken@1362
    27
INSTALL = @INSTALL@
slouken@1362
    28
NASM	= @NASM@ @NASMFLAGS@
slouken@1419
    29
AR	= @AR@
slouken@1419
    30
RANLIB	= @RANLIB@
slouken@2204
    31
WINDRES	= @WINDRES@
slouken@1362
    32
slouken@1362
    33
TARGET  = libSDL.la
slouken@1362
    34
OBJECTS = @OBJECTS@
slouken@3334
    35
VERSION_OBJECTS = @VERSION_OBJECTS@
slouken@1362
    36
slouken@1397
    37
SDLMAIN_TARGET = libSDLmain.a
slouken@1397
    38
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    39
slouken@3257
    40
# PS3 SPU programs
slouken@3257
    41
SPU_GCC = @SPU_GCC@
slouken@3257
    42
EMBEDSPU = @EMBEDSPU@
slouken@3258
    43
#include $(srcdir)/src/video/ps3/spulibs/Makefile
slouken@3257
    44
slouken@3344
    45
DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode
slouken@1362
    46
slouken@3263
    47
HDRS = SDL.h SDL_atomic.h SDL_audio.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
slouken@2122
    48
slouken@1362
    49
LT_AGE      = @LT_AGE@
slouken@1362
    50
LT_CURRENT  = @LT_CURRENT@
slouken@1362
    51
LT_RELEASE  = @LT_RELEASE@
slouken@1362
    52
LT_REVISION = @LT_REVISION@
slouken@2156
    53
LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
    54
slouken@3311
    55
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1622
    56
slouken@1622
    57
$(srcdir)/configure: $(srcdir)/configure.in
slouken@1622
    58
	@echo "Warning, configure.in is out of date"
slouken@1622
    59
	#(cd $(srcdir) && sh autogen.sh && sh configure)
slouken@1623
    60
	@sleep 3
slouken@1362
    61
slouken@1362
    62
Makefile: $(srcdir)/Makefile.in
slouken@1362
    63
	$(SHELL) config.status $@
slouken@1362
    64
slouken@1362
    65
$(objects):
slouken@1391
    66
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    67
slouken@3311
    68
# To make sure parallel builds will not fail
slouken@3311
    69
$(srcdir)/include/SDL_revision.h: update-revision
slouken@3311
    70
slouken@2982
    71
update-revision:
slouken@2982
    72
	$(SHELL) $(auxdir)/updaterev.sh
slouken@2982
    73
slouken@3352
    74
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist
slouken@1362
    75
slouken@3334
    76
-include $(OBJECTS:.lo=.d)
slouken@3334
    77
@DEPENDS@
slouken@3334
    78
@VERSION_DEPENDS@
slouken@3334
    79
@SDLMAIN_DEPENDS@
slouken@1362
    80
slouken@3334
    81
$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
slouken@3334
    82
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
slouken@1362
    83
slouken@1397
    84
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1419
    85
	$(AR) cru $@ $(SDLMAIN_OBJECTS)
slouken@1419
    86
	$(RANLIB) $@
slouken@1397
    87
slouken@3352
    88
install: all install-bin install-hdrs install-lib install-data
slouken@1362
    89
install-bin:
slouken@2156
    90
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
slouken@2156
    91
	$(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
slouken@1362
    92
install-hdrs:
slouken@2156
    93
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
slouken@2122
    94
	for file in $(HDRS); do \
slouken@2156
    95
	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
slouken@1362
    96
	done
slouken@2156
    97
	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
slouken@2151
    98
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@2156
    99
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
slouken@2156
   100
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
slouken@2156
   101
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
slouken@2156
   102
	$(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   103
install-data:
slouken@2156
   104
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
slouken@2156
   105
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
slouken@2156
   106
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
slouken@2156
   107
	$(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
slouken@1362
   108
slouken@3352
   109
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
slouken@1362
   110
uninstall-bin:
slouken@2156
   111
	rm -f $(DESTDIR)$(bindir)/sdl-config
slouken@1362
   112
uninstall-hdrs:
slouken@2122
   113
	for file in $(HDRS); do \
slouken@2156
   114
	    rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
slouken@1362
   115
	done
slouken@2156
   116
	rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h
slouken@2156
   117
	-rmdir $(DESTDIR)$(includedir)/SDL
slouken@1362
   118
uninstall-lib:
slouken@2156
   119
	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
slouken@2156
   120
	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   121
uninstall-data:
slouken@2156
   122
	rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
icculus@3355
   123
	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
slouken@1362
   124
slouken@1362
   125
clean:
slouken@1362
   126
	rm -rf $(objects)
slouken@1380
   127
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   128
slouken@1362
   129
distclean: clean
slouken@1362
   130
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1362
   131
	rm -f SDL.qpg
slouken@3334
   132
	rm -f config.status config.cache config.log libtool
slouken@1362
   133
	rm -rf $(srcdir)/autom4te*
slouken@1603
   134
	find $(srcdir) \( \
slouken@1603
   135
	    -name '*~' -o \
slouken@1603
   136
	    -name '*.bak' -o \
slouken@1603
   137
	    -name '*.old' -o \
slouken@1603
   138
	    -name '*.rej' -o \
slouken@1603
   139
	    -name '*.orig' -o \
slouken@1603
   140
	    -name '.#*' \) \
slouken@1362
   141
	    -exec rm -f {} \;
slouken@1603
   142
	cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
slouken@1380
   143
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   144
slouken@1362
   145
dist $(distfile):
slouken@1391
   146
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   147
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1603
   148
	cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
slouken@2982
   149
	$(SHELL) $(distdir)/build-scripts/updaterev.sh
slouken@1651
   150
	rm -rf `find $(distdir) -name .svn`
slouken@1846
   151
	find $(distdir) \( \
slouken@1845
   152
	    -name '*~' -o \
slouken@1845
   153
	    -name '*.bak' -o \
slouken@1845
   154
	    -name '*.old' -o \
slouken@1845
   155
	    -name '*.rej' -o \
slouken@1845
   156
	    -name '*.orig' -o \
slouken@1845
   157
	    -name '.#*' \) \
slouken@1845
   158
	    -exec rm -f {} \;
slouken@1848
   159
	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
slouken@1362
   160
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   161
	rm -rf $(distdir)
slouken@1362
   162
slouken@1362
   163
rpm: $(distfile)
slouken@1362
   164
	rpmbuild -ta $?
slouken@1424
   165
slouken@1895
   166
# Run indent on the source to standardize coding style
slouken@1895
   167
indent:
slouken@1895
   168
	@echo "Running indent... modified files:"
slouken@1895
   169
	@cd $(srcdir) && \
slouken@1895
   170
	find . \( \
slouken@1895
   171
	    -name '*.h' -o \
slouken@1895
   172
	    -name '*.c' -o \
slouken@1895
   173
	    -name '*.cc' \) \
slouken@2220
   174
	    -print | fgrep -v ./Xcode | \
slouken@1895
   175
	while read file; do \
slouken@1895
   176
	    indent "$$file" -o "$$file.indent"; \
slouken@1895
   177
	    if cmp "$$file" "$$file.indent" >/dev/null; then \
slouken@1895
   178
	        rm -f "$$file.indent"; \
slouken@1895
   179
	    else \
slouken@1895
   180
	        echo "$$file"; \
slouken@1895
   181
	        mv -f "$$file.indent" "$$file"; \
slouken@1895
   182
	    fi; \
slouken@1895
   183
	done
slouken@1895
   184
slouken@1895
   185
# Run indent and then commit modified files
slouken@1895
   186
commit: indent
slouken@1895
   187
	svn commit
slouken@1895
   188
slouken@1651
   189
# Create a SVN snapshot that people can run update on
slouken@1424
   190
snapshot:
slouken@3027
   191
	$(SHELL) $(auxdir)/snapshot.sh