Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 21 Feb 2006 08:34:45 +0000
changeset 1401 1819fd069e89
parent 1397 b189a73aa335
child 1414 4fe98eace733
permissions -rw-r--r--
*** empty log message ***
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
depend	= build-deps
slouken@1362
     7
prefix = @prefix@
slouken@1362
     8
exec_prefix = @exec_prefix@
slouken@1390
     9
bindir	= $(DESTDIR)@bindir@
slouken@1390
    10
libdir  = $(DESTDIR)@libdir@
slouken@1390
    11
includedir = $(DESTDIR)@includedir@
slouken@1390
    12
datadir	= $(DESTDIR)@datadir@
slouken@1390
    13
mandir	= $(DESTDIR)@mandir@
slouken@1391
    14
auxdir	= @ac_aux_dir@
slouken@1362
    15
distpath = $(srcdir)/..
slouken@1362
    16
distdir = SDL-@SDL_VERSION@
slouken@1362
    17
distfile = $(distdir).tar.gz
slouken@1362
    18
slouken@1380
    19
@SET_MAKE@
slouken@1362
    20
SHELL	= @SHELL@
slouken@1362
    21
CC      = @CC@
slouken@1362
    22
INCLUDE = @INCLUDE@
slouken@1362
    23
CFLAGS  = @BUILD_CFLAGS@
slouken@1393
    24
LDFLAGS = @BUILD_LDFLAGS@
slouken@1362
    25
LIBTOOL = @LIBTOOL@
slouken@1362
    26
INSTALL = @INSTALL@
slouken@1362
    27
NASM	= @NASM@ @NASMFLAGS@
slouken@1362
    28
slouken@1362
    29
TARGET  = libSDL.la
slouken@1362
    30
SOURCES = @SOURCES@
slouken@1362
    31
OBJECTS = @OBJECTS@
slouken@1362
    32
slouken@1397
    33
SDLMAIN_TARGET = libSDLmain.a
slouken@1397
    34
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
slouken@1397
    35
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    36
slouken@1362
    37
DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html EpocBuildFiles.zip include INSTALL Makefile.dc Makefile.in MPWmake.sea.bin PBProjects.tar.gz README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in setvars.cmd src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom.mif WhatsNew Xcode21.tar.gz Xcode.tar.gz XcodeUniversal.tar.gz
slouken@1362
    38
slouken@1362
    39
LT_AGE      = @LT_AGE@
slouken@1362
    40
LT_CURRENT  = @LT_CURRENT@
slouken@1362
    41
LT_RELEASE  = @LT_RELEASE@
slouken@1362
    42
LT_REVISION = @LT_REVISION@
slouken@1362
    43
LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
    44
slouken@1401
    45
all: Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1362
    46
slouken@1362
    47
Makefile: $(srcdir)/Makefile.in
slouken@1362
    48
	$(SHELL) config.status $@
slouken@1362
    49
slouken@1362
    50
$(objects):
slouken@1391
    51
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    52
slouken@1362
    53
.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
slouken@1362
    54
depend:
slouken@1362
    55
	SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" objects="$(objects)" output="$(depend)" \
slouken@1391
    56
	$(SHELL) $(auxdir)/makedep.sh
slouken@1397
    57
	for src in $(SDLMAIN_SOURCES); do \
slouken@1397
    58
	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
slouken@1397
    59
	    echo "$(objects)/$$obj: $$src" >>$(depend); \
slouken@1397
    60
	    echo "	\$$(CC) \$$(CFLAGS) -c $$src -o \$$@" >>$(depend); \
slouken@1397
    61
	done
slouken@1362
    62
slouken@1362
    63
include $(depend)
slouken@1362
    64
slouken@1362
    65
$(objects)/$(TARGET): $(OBJECTS)
slouken@1362
    66
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) $(LT_LDFLAGS)
slouken@1362
    67
slouken@1397
    68
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1397
    69
	@AR@ cru $@ $(SDLMAIN_OBJECTS)
slouken@1397
    70
	@RANLIB@ $@
slouken@1397
    71
slouken@1362
    72
install: install-bin install-hdrs install-lib install-data install-man
slouken@1362
    73
install-bin:
slouken@1391
    74
	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
slouken@1362
    75
	$(INSTALL) -m 755 $(srcdir)/sdl-config $(bindir)/sdl-config
slouken@1362
    76
install-hdrs:
slouken@1391
    77
	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
slouken@1362
    78
	for src in $(srcdir)/include/*.h; do \
slouken@1362
    79
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    80
	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
slouken@1362
    81
	done
slouken@1394
    82
	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
slouken@1362
    83
install-lib:
slouken@1391
    84
	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
slouken@1362
    85
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
slouken@1397
    86
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
    87
install-data:
slouken@1391
    88
	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
slouken@1394
    89
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
slouken@1362
    90
install-man:
slouken@1391
    91
	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
slouken@1362
    92
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
    93
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    94
	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
slouken@1362
    95
	done
slouken@1362
    96
slouken@1362
    97
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-man
slouken@1362
    98
uninstall-bin:
slouken@1362
    99
	rm -f $(bindir)/sdl-config
slouken@1362
   100
uninstall-hdrs:
slouken@1362
   101
	for src in $(srcdir)/include/*.h; do \
slouken@1362
   102
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   103
	    rm -f $(includedir)/SDL/$$file; \
slouken@1362
   104
	done
slouken@1362
   105
	rm -f $(includedir)/SDL/SDL_config.h
slouken@1362
   106
uninstall-lib:
slouken@1362
   107
	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
slouken@1397
   108
	rm -f $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   109
uninstall-data:
slouken@1362
   110
	rm -f $(datadir)/aclocal/sdl.m4
slouken@1362
   111
uninstall-man:
slouken@1362
   112
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   113
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   114
	    rm -f $(mandir)/man3/$$file; \
slouken@1362
   115
	done
slouken@1362
   116
slouken@1362
   117
clean:
slouken@1362
   118
	rm -rf $(objects)
slouken@1380
   119
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   120
slouken@1362
   121
distclean: clean
slouken@1362
   122
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1362
   123
	rm -f SDL.qpg
slouken@1362
   124
	rm -f config.status config.cache config.log libtool $(depend)
slouken@1362
   125
	rm -rf $(srcdir)/autom4te*
slouken@1362
   126
	find $(srcdir) \
slouken@1362
   127
	    -name '*~' -o -name '*.bak' -o -name '*.old' -o -name '*.rej' -o \
slouken@1362
   128
	    -name '.#*' \
slouken@1362
   129
	    -exec rm -f {} \;
slouken@1362
   130
	cp include/SDL_config.h.minimal include/SDL_config.h
slouken@1380
   131
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   132
slouken@1362
   133
dist $(distfile):
slouken@1391
   134
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   135
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1362
   136
	rm -rf `find $(distdir) -name CVS`
slouken@1382
   137
	rm -f `find $(distdir) -name '.cvsignore'`
slouken@1362
   138
	rm -f `find $(distdir) -name '.#*'`
slouken@1397
   139
	rmdir `find $(distdir) -type d -empty`
slouken@1362
   140
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   141
	rm -rf $(distdir)
slouken@1362
   142
slouken@1362
   143
rpm: $(distfile)
slouken@1362
   144
	rpmbuild -ta $?