Parent Directory | Revision Log
Revision 512 - (view) (download)
1 : | edgomez | 512 | ############################################################################# |
2 : | # | ||
3 : | # GNU/Linux PPC Makefile | ||
4 : | # | ||
5 : | # Edit this file to enable/disable optimizations | ||
6 : | # | ||
7 : | # $Id: Makefile.linuxppc,v 1.7 2002-09-22 12:13:21 edgomez Exp $ | ||
8 : | # | ||
9 : | ############################################################################# | ||
10 : | canard | 44 | |
11 : | include Makefile.inc | ||
12 : | |||
13 : | edgomez | 512 | # You can set/add options to CC and CFLAGS without editing this Makefile |
14 : | # You have just to export an environment CC/CFLAGS variable before running | ||
15 : | # make. | ||
16 : | # | ||
17 : | # Examples : | ||
18 : | # $ export CC='gcc-3.1' | ||
19 : | # $ export CFLAGS='-maccumulate-outgoing-args' | ||
20 : | # $ make | ||
21 : | # ... | ||
22 : | canard | 44 | |
23 : | edgomez | 512 | # You can choose a specific compiler here removing the sharp symbol |
24 : | # - Default is 'cc' which is a symlink to your default distro gcc | ||
25 : | |||
26 : | |||
27 : | # CC = gcc | ||
28 : | # CC = gcc-3.1 | ||
29 : | |||
30 : | # Assembler | ||
31 : | AS = as | ||
32 : | |||
33 : | # Constants which should not be modified | ||
34 : | CFLAGS += -DLINUX | ||
35 : | CFLAGS += -DARCH_PPC | ||
36 : | CFLAGS += -DARCH_IS_BIG_ENDIAN | ||
37 : | |||
38 : | # Enable some experimental/debugging code | ||
39 : | # (Use only if you know what you're doing !) | ||
40 : | # PSNR during encoding | ||
41 : | # CFLAGS += -D_DEBUG_PSNR | ||
42 : | |||
43 : | # Enable BFrame decoding (still beta) | ||
44 : | # CFLAGS += -DBRAMES_DEC | ||
45 : | |||
46 : | canard | 44 | LIBDIR = /usr/local/lib |
47 : | |||
48 : | edgomez | 512 | # Warning level options |
49 : | # Shows all warnings | ||
50 : | CFLAGS += -Wall | ||
51 : | # To detect non ANSI C code (xvid is not ANSI C (yet?)) | ||
52 : | # CFLAGS += -pedantic | ||
53 : | canard | 44 | |
54 : | canard | 93 | |
55 : | edgomez | 512 | # General Optimization options |
56 : | # Optimize code for size (implies -O2) | ||
57 : | CFLAGS += -Os | ||
58 : | # Unroll loops code, this might speed up loops | ||
59 : | CFLAGS += -funroll-loops | ||
60 : | # Generates FPU math code | ||
61 : | CFLAGS += -ffast-math | ||
62 : | # ??? (man gcc) | ||
63 : | CFLAGS += -fstrict-aliasing | ||
64 : | # Omit the frame pointer saving at function beginning | ||
65 : | CFLAGS += -fomit-frame-pointer | ||
66 : | # Generates Position Independant Code depending on your nasm version, | ||
67 : | # this could generate shared libraries that segfault because of a nasm | ||
68 : | # bug | ||
69 : | CFLAGS += -fPIC | ||
70 : | canard | 92 | |
71 : | edgomez | 512 | # Debugging and Profiling options |
72 : | # Writes debugging symbols in object files | ||
73 : | # CFLAGS += -g | ||
74 : | # Includes profiling code in generated code, don't forget to disable | ||
75 : | # -fomit-frame-pointer as these 2 options are exclusive. | ||
76 : | # CFLAGS += -pg | ||
77 : | # Precise profiling + test coverage (-pg must be activated) | ||
78 : | # Build the library twice and execute a program using the lib twice too | ||
79 : | # First pass : Will create sourcefile.da files to keep branch statistics | ||
80 : | # CFLAGS += -fprofile-arcs | ||
81 : | # Second pass : Will create .bb and .bbg files suitable for coverage and | ||
82 : | # branch probabilities during compilation | ||
83 : | # CFLAGS += -fprofile-arcs -fbranch-probabilities -ftest-coverage | ||
84 : | canard | 92 | |
85 : | edgomez | 512 | ############################################################################# |
86 : | # | ||
87 : | # Makefile rules | ||
88 : | # | ||
89 : | ############################################################################# | ||
90 : | canard | 44 | |
91 : | canard | 52 | %.o: %.s |
92 : | $(AS) $< -o $@ | ||
93 : | canard | 44 | |
94 : | RM = rm -rf | ||
95 : | |||
96 : | all: $(LIB) $(LIBSO) | ||
97 : | |||
98 : | canard | 52 | $(LIB): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
99 : | canard | 44 | ar rcs $@ $^ |
100 : | |||
101 : | canard | 52 | $(LIBSO): $(SRC:.c=.o) $(SRC_PPC:.s=.o) |
102 : | canard | 44 | $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ |
103 : | |||
104 : | clean: | ||
105 : | $(RM) `find $(SRCDIR) -name "*.o"` | ||
106 : | $(RM) $(LIB) | ||
107 : | $(RM) $(LIBSO) | ||
108 : | |||
109 : | edgomez | 512 | install: $(LIBSO) $(LIB) |
110 : | cp $(LIBSO) $(LIBDIR) # you have to be root for this | ||
111 : | cp $(LIB) $(LIBDIR) | ||
112 : | canard | 44 | /sbin/ldconfig |
113 : | |||
114 : | edgomez | 512 | install-test: $(LIBSO) # if you don't want to overwrite previous compile |
115 : | cp $(LIBSO) $(LIBDIR)/libtestcore.so | ||
116 : | canard | 44 | /sbin/ldconfig |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |