1 |
############################################################################## |
############################################################################## |
2 |
# |
# |
3 |
# - Unified Makefile for XviD for *nix environments - |
# - Unified Makefile for Xvid for *nix environments - |
4 |
# |
# |
5 |
# Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr> |
# Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr> |
6 |
# |
# |
7 |
# |
# |
8 |
# Description: |
# Description: |
9 |
# This Makefile allows building XviD sources to obtain a shared library |
# This Makefile allows building Xvid sources to obtain a shared library |
10 |
# and a static library. This Makefile uses variables defined in the |
# and a static library. This Makefile uses variables defined in the |
11 |
# platform.inc file. This platform.inc file is usually created by the |
# platform.inc file. This platform.inc file is usually created by the |
12 |
# ./configure script whenever a unix shell is available. |
# ./configure script whenever a unix shell is available. |
13 |
# |
# |
14 |
# Makefile functionnal dependencies: |
# Makefile functional dependencies: |
15 |
# - echo |
# - echo |
16 |
# - rm (with option -r and -f) |
# - rm (with option -r and -f) |
17 |
# - cd |
# - cd |
18 |
# - make VPATH support (eg: GNU make, solaris 8 make) |
# - make VPATH support (eg: GNU make, solaris 8 make) |
19 |
|
# - ar |
20 |
# |
# |
21 |
# Building output: |
# Building output: |
22 |
# - C means "_C_ompiling" |
# - C means "_C_ompiling" |
55 |
OBJECTS = $(GENERIC_OBJECTS) |
OBJECTS = $(GENERIC_OBJECTS) |
56 |
OBJECTS += $(ASSEMBLY_OBJECTS) |
OBJECTS += $(ASSEMBLY_OBJECTS) |
57 |
OBJECTS += $(DCT_IA64_OBJECTS) |
OBJECTS += $(DCT_IA64_OBJECTS) |
58 |
|
OBJECTS += $(PPC_ALTIVEC_OBJECTS) |
59 |
|
|
60 |
# The VPATH mecanism could use a "per target" build directory |
# The VPATH mechanism could use a "per target" build directory |
61 |
# To keep it simple at the moment, the directory is fixed to "build" |
# To keep it simple at the moment, the directory is fixed to "build" |
62 |
BUILD_DIR = =build |
BUILD_DIR = =build |
63 |
VPATH = $(SRC_DIR):$(BUILD_DIR) |
VPATH = $(SRC_DIR):$(BUILD_DIR) |
71 |
all: $(STATIC_LIB) $(SHARED_LIB) |
all: $(STATIC_LIB) $(SHARED_LIB) |
72 |
@echo |
@echo |
73 |
@echo "---------------------------------------------------------------" |
@echo "---------------------------------------------------------------" |
74 |
@echo " XviD has been successfully built." |
@echo " Xvid has been successfully built." |
75 |
@echo |
@echo |
76 |
@echo " * Binaries are currently located in the '$(BUILD_DIR)' directory" |
@echo " * Binaries are currently located in the '$(BUILD_DIR)' directory" |
77 |
@echo " * To install them on your system, you can run '# make install'" |
@echo " * To install them on your system, you can run '# make install'" |
98 |
# Generic C rule |
# Generic C rule |
99 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
100 |
|
|
101 |
|
$(PPC_ALTIVEC_OBJECTS): CFLAGS+= $(ALTIVEC_CFLAGS) |
102 |
|
|
103 |
.c.$(OBJECT_EXTENSION): |
.c.$(OBJECT_EXTENSION): |
104 |
@echo " C: $(@D)/$(<F)" |
@echo " C: $(@D)/$(<F)" |
105 |
@$(INSTALL) -d $(BUILD_DIR)/$(@D) |
@$(INSTALL) -d $(BUILD_DIR)/$(@D) |
131 |
$(SHARED_LIB): $(BUILD_DIR) $(OBJECTS) |
$(SHARED_LIB): $(BUILD_DIR) $(OBJECTS) |
132 |
@echo " L: $(@F)" |
@echo " L: $(@F)" |
133 |
@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def |
@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def |
134 |
|
@$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld |
135 |
@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS) |
@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS) |
136 |
|
|
137 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
140 |
|
|
141 |
install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB) |
install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB) |
142 |
@echo " D: $(libdir)" |
@echo " D: $(libdir)" |
143 |
@$(INSTALL) -d $(libdir) |
@$(INSTALL) -d $(DESTDIR)$(libdir) |
144 |
@echo " I: $(libdir)/$(SHARED_LIB)" |
@echo " I: $(libdir)/$(SHARED_LIB)" |
145 |
@$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(libdir)/$(SHARED_LIB) |
@$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB) |
146 |
@echo " I: $(libdir)/$(STATIC_LIB)" |
@echo " I: $(libdir)/$(STATIC_LIB)" |
147 |
@$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(libdir)/$(STATIC_LIB) |
@$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB) |
148 |
@echo " D: $(includedir)" |
@echo " D: $(includedir)" |
149 |
@$(INSTALL) -d $(includedir) |
@$(INSTALL) -d $(DESTDIR)$(includedir) |
150 |
@echo " I: $(includedir)/xvid.h" |
@echo " I: $(includedir)/xvid.h" |
151 |
@$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(includedir)/xvid.h |
@$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h |
152 |
|
|
153 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
154 |
# Platorm specific file -- dumb rules for people executing make before |
# Platorm specific file -- dumb rules for people executing make before |
180 |
@$(RM) autom4te.cache |
@$(RM) autom4te.cache |
181 |
|
|
182 |
mrproper: distclean |
mrproper: distclean |
183 |
@echo " Cl: Boostrapped build files" |
@echo " Cl: Bootstrapped build files" |
184 |
@$(RM) configure |
@$(RM) configure |
185 |
@$(RM) install-sh |
@$(RM) install-sh |
186 |
@$(RM) missing |
@$(RM) missing |