1 |
############################################################################## |
############################################################################## |
2 |
# |
# |
3 |
# - Unified Makefile for XviD for *nix environments - |
# - Unified Makefile for Xvid for *nix environments - |
4 |
# |
# |
5 |
# Copyright(C) 2003-2004 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. |
41 |
############################################################################## |
############################################################################## |
42 |
|
|
43 |
include sources.inc |
include sources.inc |
44 |
|
ifeq ($(findstring $(MAKECMDGOALS), clean distclean mrproper),) |
45 |
include platform.inc |
include platform.inc |
46 |
|
endif |
47 |
|
|
48 |
RM = rm -rf |
RM = rm -rf |
49 |
|
|
57 |
OBJECTS = $(GENERIC_OBJECTS) |
OBJECTS = $(GENERIC_OBJECTS) |
58 |
OBJECTS += $(ASSEMBLY_OBJECTS) |
OBJECTS += $(ASSEMBLY_OBJECTS) |
59 |
OBJECTS += $(DCT_IA64_OBJECTS) |
OBJECTS += $(DCT_IA64_OBJECTS) |
60 |
|
OBJECTS += $(PPC_ALTIVEC_OBJECTS) |
61 |
|
|
62 |
# The VPATH mechanism could use a "per target" build directory |
# The VPATH mechanism could use a "per target" build directory |
63 |
# 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" |
70 |
|
|
71 |
.SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c |
.SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c |
72 |
|
|
73 |
all: $(STATIC_LIB) $(SHARED_LIB) |
all: info $(STATIC_LIB) $(SHARED_LIB) |
74 |
@echo |
@echo |
75 |
@echo "---------------------------------------------------------------" |
@echo "---------------------------------------------------------------" |
76 |
@echo " XviD has been successfully built." |
@echo " Xvid has been successfully built." |
77 |
@echo |
@echo |
78 |
@echo " * Binaries are currently located in the '$(BUILD_DIR)' directory" |
@echo " * Binaries are currently located in the '$(BUILD_DIR)' directory" |
79 |
@echo " * To install them on your system, you can run '# make install'" |
@echo " * To install them on your system, you can run '# make install'" |
100 |
# Generic C rule |
# Generic C rule |
101 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
102 |
|
|
103 |
|
$(PPC_ALTIVEC_OBJECTS): CFLAGS+= $(ALTIVEC_CFLAGS) |
104 |
|
|
105 |
.c.$(OBJECT_EXTENSION): |
.c.$(OBJECT_EXTENSION): |
106 |
@echo " C: $(@D)/$(<F)" |
@echo " C: $(@D)/$(<F)" |
107 |
@$(INSTALL) -d $(BUILD_DIR)/$(@D) |
@$(INSTALL) -d $(BUILD_DIR)/$(@D) |
113 |
|
|
114 |
$(STATIC_LIB): $(BUILD_DIR) $(OBJECTS) |
$(STATIC_LIB): $(BUILD_DIR) $(OBJECTS) |
115 |
@echo " L: $(@F)" |
@echo " L: $(@F)" |
116 |
@cd $(BUILD_DIR) && ar rc $(@F) $(OBJECTS) && $(RANLIB) $(@F) |
@cd $(BUILD_DIR) && $(AR) rc $(@F) $(OBJECTS) && $(RANLIB) $(@F) |
117 |
|
|
118 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
119 |
# Shared Library |
# Shared Library |
133 |
$(SHARED_LIB): $(BUILD_DIR) $(OBJECTS) |
$(SHARED_LIB): $(BUILD_DIR) $(OBJECTS) |
134 |
@echo " L: $(@F)" |
@echo " L: $(@F)" |
135 |
@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def |
@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def |
136 |
|
@$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld |
137 |
@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS) |
@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS) |
138 |
|
|
139 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
142 |
|
|
143 |
install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB) |
install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB) |
144 |
@echo " D: $(libdir)" |
@echo " D: $(libdir)" |
145 |
@$(INSTALL) -d $(libdir) |
@$(INSTALL) -d $(DESTDIR)$(libdir) |
146 |
@echo " I: $(libdir)/$(SHARED_LIB)" |
@echo " I: $(libdir)/$(SHARED_LIB)" |
147 |
@$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(libdir)/$(SHARED_LIB) |
@$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB) |
148 |
@echo " I: $(libdir)/$(STATIC_LIB)" |
@echo " I: $(libdir)/$(STATIC_LIB)" |
149 |
@$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(libdir)/$(STATIC_LIB) |
@$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB) |
150 |
@echo " D: $(includedir)" |
@echo " D: $(includedir)" |
151 |
@$(INSTALL) -d $(includedir) |
@$(INSTALL) -d $(DESTDIR)$(includedir) |
152 |
@echo " I: $(includedir)/xvid.h" |
@echo " I: $(includedir)/xvid.h" |
153 |
@$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(includedir)/xvid.h |
@$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h |
154 |
|
|
155 |
#----------------------------------------------------------------------------- |
#----------------------------------------------------------------------------- |
156 |
# Platorm specific file -- dumb rules for people executing make before |
# Platorm specific file -- dumb rules for people executing make before |