Makefile.in
author Sam Lantinga <slouken@libsdl.org>
Wed, 26 Apr 2006 20:30:11 +0000
changeset 1651 0a9be1057095
parent 1634 14f302c5b32c
child 1659 14717b52abc0
child 1750 025e1a273f47
permissions -rw-r--r--
subversion conversion complete!
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@1521
    24
EXTRA_CFLAGS = @EXTRA_CFLAGS@
slouken@1393
    25
LDFLAGS = @BUILD_LDFLAGS@
slouken@1521
    26
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
slouken@1362
    27
LIBTOOL = @LIBTOOL@
slouken@1362
    28
INSTALL = @INSTALL@
slouken@1362
    29
NASM	= @NASM@ @NASMFLAGS@
slouken@1419
    30
AR	= @AR@
slouken@1419
    31
RANLIB	= @RANLIB@
slouken@1362
    32
slouken@1362
    33
TARGET  = libSDL.la
slouken@1362
    34
SOURCES = @SOURCES@
slouken@1362
    35
OBJECTS = @OBJECTS@
slouken@1362
    36
slouken@1397
    37
SDLMAIN_TARGET = libSDLmain.a
slouken@1397
    38
SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
slouken@1397
    39
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    40
slouken@1580
    41
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.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip WhatsNew Xcode.tar.gz
slouken@1362
    42
slouken@1362
    43
LT_AGE      = @LT_AGE@
slouken@1362
    44
LT_CURRENT  = @LT_CURRENT@
slouken@1362
    45
LT_RELEASE  = @LT_RELEASE@
slouken@1362
    46
LT_REVISION = @LT_REVISION@
slouken@1362
    47
LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
    48
slouken@1622
    49
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
slouken@1622
    50
slouken@1622
    51
$(srcdir)/configure: $(srcdir)/configure.in
slouken@1622
    52
	@echo "Warning, configure.in is out of date"
slouken@1622
    53
	#(cd $(srcdir) && sh autogen.sh && sh configure)
slouken@1623
    54
	@sleep 3
slouken@1362
    55
slouken@1362
    56
Makefile: $(srcdir)/Makefile.in
slouken@1362
    57
	$(SHELL) config.status $@
slouken@1362
    58
slouken@1362
    59
$(objects):
slouken@1391
    60
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
    61
slouken@1362
    62
.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
    63
depend:
slouken@1634
    64
	@SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \
slouken@1391
    65
	$(SHELL) $(auxdir)/makedep.sh
slouken@1419
    66
	@for src in $(SDLMAIN_SOURCES); do \
slouken@1397
    67
	    obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \
slouken@1634
    68
	    echo "\$$(objects)/$$obj: $$src" >>$(depend); \
slouken@1522
    69
	    echo "	\$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \
slouken@1397
    70
	done
slouken@1362
    71
slouken@1362
    72
include $(depend)
slouken@1362
    73
slouken@1362
    74
$(objects)/$(TARGET): $(OBJECTS)
slouken@1521
    75
	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
slouken@1362
    76
slouken@1397
    77
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@1419
    78
	$(AR) cru $@ $(SDLMAIN_OBJECTS)
slouken@1419
    79
	$(RANLIB) $@
slouken@1397
    80
slouken@1362
    81
install: install-bin install-hdrs install-lib install-data install-man
slouken@1362
    82
install-bin:
slouken@1391
    83
	$(SHELL) $(auxdir)/mkinstalldirs $(bindir)
slouken@1476
    84
	$(INSTALL) -m 755 sdl-config $(bindir)/sdl-config
slouken@1362
    85
install-hdrs:
slouken@1391
    86
	$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
slouken@1362
    87
	for src in $(srcdir)/include/*.h; do \
slouken@1362
    88
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
    89
	    $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \
slouken@1362
    90
	done
slouken@1394
    91
	$(INSTALL) -m 644 include/SDL_config.h $(includedir)/SDL/SDL_config.h
slouken@1362
    92
install-lib:
slouken@1391
    93
	$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
slouken@1362
    94
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
slouken@1397
    95
	$(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(libdir)/$(SDLMAIN_TARGET)
slouken@1419
    96
	$(RANLIB) $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
    97
install-data:
slouken@1391
    98
	$(SHELL) $(auxdir)/mkinstalldirs $(datadir)/aclocal
slouken@1394
    99
	$(INSTALL) -m 644 $(srcdir)/sdl.m4 $(datadir)/aclocal/sdl.m4
slouken@1362
   100
install-man:
slouken@1391
   101
	$(SHELL) $(auxdir)/mkinstalldirs $(mandir)/man3
slouken@1362
   102
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   103
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1394
   104
	    $(INSTALL) -m 644 $$src $(mandir)/man3/$$file; \
slouken@1362
   105
	done
slouken@1362
   106
slouken@1603
   107
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man
slouken@1362
   108
uninstall-bin:
slouken@1362
   109
	rm -f $(bindir)/sdl-config
slouken@1362
   110
uninstall-hdrs:
slouken@1362
   111
	for src in $(srcdir)/include/*.h; do \
slouken@1362
   112
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   113
	    rm -f $(includedir)/SDL/$$file; \
slouken@1362
   114
	done
slouken@1362
   115
	rm -f $(includedir)/SDL/SDL_config.h
slouken@1603
   116
	-rmdir $(includedir)/SDL
slouken@1362
   117
uninstall-lib:
slouken@1362
   118
	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
slouken@1397
   119
	rm -f $(libdir)/$(SDLMAIN_TARGET)
slouken@1362
   120
uninstall-data:
slouken@1362
   121
	rm -f $(datadir)/aclocal/sdl.m4
slouken@1362
   122
uninstall-man:
slouken@1362
   123
	for src in $(srcdir)/docs/man3/*.3; do \
slouken@1362
   124
	    file=`echo $$src | sed -e 's|^.*/||'`; \
slouken@1362
   125
	    rm -f $(mandir)/man3/$$file; \
slouken@1362
   126
	done
slouken@1362
   127
slouken@1362
   128
clean:
slouken@1362
   129
	rm -rf $(objects)
slouken@1380
   130
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   131
slouken@1362
   132
distclean: clean
slouken@1362
   133
	rm -f Makefile include/SDL_config.h sdl-config
slouken@1603
   134
	rm -f include/SDL_config.h sdl-config
slouken@1362
   135
	rm -f SDL.qpg
slouken@1362
   136
	rm -f config.status config.cache config.log libtool $(depend)
slouken@1362
   137
	rm -rf $(srcdir)/autom4te*
slouken@1603
   138
	find $(srcdir) \( \
slouken@1603
   139
	    -name '*~' -o \
slouken@1603
   140
	    -name '*.bak' -o \
slouken@1603
   141
	    -name '*.old' -o \
slouken@1603
   142
	    -name '*.rej' -o \
slouken@1603
   143
	    -name '*.orig' -o \
slouken@1603
   144
	    -name '.#*' \) \
slouken@1362
   145
	    -exec rm -f {} \;
slouken@1603
   146
	cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
slouken@1380
   147
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   148
slouken@1362
   149
dist $(distfile):
slouken@1391
   150
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@1362
   151
	tar cf - $(DIST) | (cd $(distdir); tar xf -)
slouken@1603
   152
	cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
slouken@1651
   153
	rm -rf `find $(distdir) -name .svn`
slouken@1362
   154
	rm -f `find $(distdir) -name '.#*'`
slouken@1397
   155
	rmdir `find $(distdir) -type d -empty`
slouken@1362
   156
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   157
	rm -rf $(distdir)
slouken@1362
   158
slouken@1362
   159
rpm: $(distfile)
slouken@1362
   160
	rpmbuild -ta $?
slouken@1424
   161
slouken@1651
   162
# Create a SVN snapshot that people can run update on
slouken@1424
   163
snapshot:
slouken@1651
   164
	svn co svn://libsdl.org/trunk/SDL
slouken@1651
   165
	(cd SDL && ./autogen.sh && rm -rf autom4te.cache)
slouken@1651
   166
	cp SDL/include/SDL_config.h.default SDL/include/SDL_config.h
slouken@1651
   167
	mv SDL SDL-1.2
slouken@1448
   168
	tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
slouken@1451
   169
	rm -f $(HOME)/SDL-1.2.zip
slouken@1448
   170
	zip -r $(HOME)/SDL-1.2.zip SDL-1.2
slouken@1424
   171
	rm -rf SDL-1.2