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