]> git.sesse.net Git - ccbs/blob - bigscreen/tinyptc/Makefile
Only allocate space for four digits in the score screen -- if somebody actually gets...
[ccbs] / bigscreen / tinyptc / Makefile
1 # TinyPTC x11 v0.7.3 Makefile
2 # Copyright (C) 2000-2002 Alessandro Gatti <a.gatti@tiscali.it>
3 #
4 # http://www.sourceforge.net/projects/tinyptc/
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 CFLAGS      = -Wall -Wno-unknown-pragmas -Os
21 CC          = gcc
22 CPP         = cpp
23 SH          = /bin/sh
24 LFLAGS      = -s
25 LD          = gcc
26 AFLAGS      = -f elf
27 AS          = nasm
28 AR          = ar
29 RANLIB      = ranlib
30 STRIP       = strip
31 SWIG        = swig
32 RM          = /bin/rm -f
33 INCLUDES    = -I/usr/X11R6/include -I/usr/local/include -I/usr/include
34 LIBS        = -L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib -lX11 -lXext \
35         -lXxf86dga -lXxf86vm -lXv
36 CSOURCES    = test.c
37 CTARGETS    = xlib.c xdbe.c xshm.c convert.c xdga1.c xdga2.c xvshm.c
38 ASOURCES    = mmx.s yv12.s
39 OTARGETS    = $(CTARGETS:.c=.o)
40 COBJECTS    = $(CSOURCES:.c=.o)
41 AOBJECTS    = $(ASOURCES:.s=.o)
42 EXECUTABLE  = tinyptc_test
43 LIBRARY     = libtinyptc.a
44
45 # Feel free to change this.
46 PYTHON_VERSION = 2.2
47
48 $(EXECUTABLE): $(OTARGETS) $(COBJECTS) $(LIBRARY)
49         $(LD) $(LDFLAGS) $(OTARGETS) $(COBJECTS) $(AOBJECTS) $(LIBS) -o $(EXECUTABLE)
50         $(STRIP) --strip-all $(EXECUTABLE)
51         $(STRIP) --remove-section=".comment" $(EXECUTABLE)
52         $(STRIP) --remove-section=".note" $(EXECUTABLE)
53
54 $(LIBRARY): $(OTARGETS) $(AOBJECTS)
55         $(AR) cru $(LIBRARY) $(OTARGETS) $(AOBJECTS)
56         $(RANLIB) $(LIBRARY)
57
58 %.o: %.c
59         $(CC) $(CFLAGS) $(INCLUDES) -c $<
60
61 # Unfortunately makedepend doesn't work for assembly files...
62
63 mmx.i: mmx.h
64         $(CPP) $(INCLUDES) mmx.h | $(SH) buildmmx.sh > mmx.i
65
66 mmx.o: mmx.s mmx.i
67         $(AS) $(AFLAGS) mmx.s
68
69 yv12.o: yv12.s
70         $(AS) $(AFLAGS) yv12.s
71
72 python: $(LIBRARY)
73         $(RM) ptctarget.o
74         $(CPP) $(INCLUDES) tinyptc.h | $(SH) findused.sh
75         $(SWIG) -python tinyptc.h
76         $(CC) -c tinyptc_wrap.c -I/usr/include/python$(PYTHON_VERSION) \
77         -I/usr/local/include/python$(PYTHON_VERSION) $(INCLUDES)
78         $(CC) -shared $(LIBS) $(LIBRARY) convert.o ptctarget.o tinyptc_wrap.o \
79         -o _TinyPTC.so
80
81 .depend:
82         $(RM) .depend 2> /dev/null
83         makedepend -f- -- $(INCLUDES) $(CFLAGS) $(CSOURCES) > .depend 2> /dev/null
84
85 clean:
86         $(RM) $(EXECUTABLE) $(LIBRARY) $(OTARGETS) $(COBJECTS) $(AOBJECTS)
87         $(RM) ptctarget.o .depend mmx.i tinyptc_wrap.[co] TinyPTC.py*
88         $(RM) _TinyPTC.so
89
90 include .depend