1 |
#/************************************************************************** |
#/************************************************************************** |
2 |
# * |
# * |
3 |
# * linux makefile |
# * Linux PPC makefile |
4 |
# * |
# * |
5 |
# * nasm args: |
# * Adapted from linux x86 Makefile by Guillaume Morin <guillaume@morinfr.org> |
|
# * -f fmt elf (linux), coff (djgpp) |
|
|
# * -DPREFIX add '_' prefix to symbol names |
|
6 |
# * |
# * |
7 |
# * libso: |
# * libso: |
8 |
# * (-lm not neccessary if using -ffast-math) |
# * (-lm not neccessary if using -ffast-math) |
10 |
# *************************************************************************/ |
# *************************************************************************/ |
11 |
|
|
12 |
|
|
|
# |
|
|
# Adapted from linux x86 Makefile by Guillaume Morin <guillaume@morinfr.org> |
|
|
# |
|
|
# This needs lots of work but that is a good beginning :-) |
|
|
|
|
13 |
include Makefile.inc |
include Makefile.inc |
14 |
|
|
15 |
CC = gcc |
CC = gcc |
|
#CC=icc |
|
|
#CC = /opt/experimental/bin/gcc # that's where SuSE installs gcc3 |
|
16 |
|
|
17 |
CFLAGS = -DLINUX -DARCH_PPC -DARCH_IS_BIG_ENDIAN |
CFLAGS = -DLINUX -DARCH_PPC -DARCH_IS_BIG_ENDIAN |
18 |
LIBDIR = /usr/local/lib |
LIBDIR = /usr/local/lib |
19 |
|
|
|
# CFLAGS += -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer |
|
|
# CFLAGS += -fPIC |
|
|
# CFLAGS += -m486 |
|
|
# CFLAGS += -march=pentium -mcpu=pentium |
|
|
# CFLAGS += -march=pentiumpro -mcpu=pentiumpro |
|
|
|
|
20 |
CFLAGS += -Wall -O3 -funroll-loops -ffast-math |
CFLAGS += -Wall -O3 -funroll-loops -ffast-math |
21 |
CFLAGS += -fstrict-aliasing -fomit-frame-pointer |
CFLAGS += -fstrict-aliasing -fomit-frame-pointer |
22 |
|
|
23 |
|
## for profiling, uncomment the next line. |
24 |
|
#CFLAGS += -D_PROFILING_ |
25 |
|
|
26 |
|
## for debugging, comment the previous lines and uncomment the next one. |
27 |
|
#CFLAGS += -Wall -g |
28 |
|
|
29 |
|
|
30 |
AS = as |
AS = as |
|
AFLAGS = -f elf |
|
31 |
|
|
32 |
%.o: %.asm |
%.o: %.s |
33 |
$(AS) $(AFLAGS) $< -o $@ |
$(AS) $< -o $@ |
34 |
|
|
35 |
RM = rm -rf |
RM = rm -rf |
36 |
|
|
|
|
|
37 |
all: $(LIB) $(LIBSO) |
all: $(LIB) $(LIBSO) |
38 |
|
|
39 |
|
$(LIB): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
|
$(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) |
|
40 |
ar rcs $@ $^ |
ar rcs $@ $^ |
41 |
|
|
42 |
|
|
43 |
$(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) |
$(LIBSO): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
44 |
$(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ |
$(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ |
45 |
|
|
|
|
|
46 |
clean: |
clean: |
47 |
$(RM) `find $(SRCDIR) -name "*.o"` |
$(RM) `find $(SRCDIR) -name "*.o"` |
48 |
|
|
49 |
remove-all: |
remove-all: |
50 |
$(RM) $(DIRS) |
$(RM) $(DIRS) |
51 |
$(RM) $(DIRS_INTEL) |
$(RM) $(DIRS_PPC) |
52 |
$(RM) $(LIB) |
$(RM) $(LIB) |
53 |
$(RM) $(LIBSO) |
$(RM) $(LIBSO) |
54 |
|
|
55 |
|
|
56 |
install: libxvidcore.so |
install: libxvidcore.so |
57 |
cp libxvidcore.so $(LIBDIR) # you have to bee root for this |
cp libxvidcore.so $(LIBDIR) # you have to be root for this |
58 |
/sbin/ldconfig |
/sbin/ldconfig |
59 |
|
|
60 |
install-test: libxvidcore.so # if you don't want to overwrite previous compile |
install-test: libxvidcore.so # if you don't want to overwrite previous compile |