mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
![Sam Hocevar](/assets/img/avatar_default.png)
* ./Makefile: we don't include the Gtk+ and SDL DLLs in the win32 package anymore, the package is now 700k instead of 4MB. * ./configure.in, ./Makefile, ./Makefile.opts.in: replaced LIB_FOO with foo_LDFLAGS and CFLAGS_BAR with bar_CFLAGS for faster builds, and moved a lot of stuff from Makefile.opts.in back to configure.in. * ./install-win32: updated script for NSIS 1.96. I hope this doesn't break too many other architectures...
86 lines
2.6 KiB
Makefile
86 lines
2.6 KiB
Makefile
###############################################################################
|
|
# vlc (VideoLAN Client) common module Makefile
|
|
# (c)2001 VideoLAN
|
|
###############################################################################
|
|
# This file should be included by all module Makefiles
|
|
###############################################################################
|
|
|
|
#
|
|
# include the local Makefile
|
|
#
|
|
include Makefile
|
|
|
|
#
|
|
# Analyze the target we are asked to build
|
|
#
|
|
module_name := $(shell echo $(MAKECMDGOALS) | sed 's@.*/\(.*\)\..*@\1@')
|
|
suff := $(shell echo $(MAKECMDGOALS) | sed 's@.*\.@@' | tr so/a lo/o)
|
|
|
|
#
|
|
# Compiler flags
|
|
#
|
|
SRC_C := $(filter %.c,$($(module_name)_SOURCES))
|
|
SRC_CPP := $(filter %.cpp,$($(module_name)_SOURCES))
|
|
|
|
ifeq (lo,$(suff))
|
|
extra_CFLAGS := $(plugins_CFLAGS) $($(module_name)_CFLAGS) \
|
|
-DMODULE_NAME=$(module_name) -DMODULE_NAME_IS_$(module_name) \
|
|
$($(module_name)_so_CFLAGS)
|
|
OBJ_ALL := $(SRC_C:%.c=%.lo.$(module_name)) $(SRC_CPP:%.cpp=%.lo.$(module_name))
|
|
else
|
|
extra_CFLAGS := $(builtins_CFLAGS) $($(module_name)_CFLAGS) \
|
|
-DMODULE_NAME=$(module_name) -DMODULE_NAME_IS_$(module_name) \
|
|
$($(module_name)_a_CFLAGS)
|
|
OBJ_ALL := $(SRC_C:%.c=%.o.$(module_name)) $(SRC_CPP:%.cpp=%.o.$(module_name))
|
|
endif
|
|
|
|
#
|
|
# Standard dependencies
|
|
#
|
|
C_DEP := $(SRC_C:%.c=.dep/%.d)
|
|
CPP_DEP := $(SRC_CPP:%.cpp=.dep/%.dpp)
|
|
|
|
export
|
|
|
|
#
|
|
# Virtual targets
|
|
#
|
|
all:
|
|
|
|
clean:
|
|
# rm -f $(PLUGIN_ALL) $(BUILTIN_ALL)
|
|
rm -f *.o *.o.* *.lo *.lo.* *.obj *.moc *.moc.* *.bak
|
|
rm -rf .dep
|
|
|
|
FORCE:
|
|
|
|
$(OBJ_ALL): ../../Makefile.modules ../../Makefile.dep ../../Makefile ../../Makefile.opts Makefile
|
|
$(OBJ_ALL): $(H_DEP:%=../../include/%)
|
|
|
|
$(C_DEP): %.d: FORCE
|
|
@$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
|
|
|
|
$(CPP_DEP): %.dpp: FORCE
|
|
@$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
|
|
|
|
$(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.d
|
|
$(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.c
|
|
$(CC) $(CFLAGS) $(extra_CFLAGS) -c $< -o $@
|
|
|
|
$(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.dpp
|
|
$(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.cpp
|
|
$(CC) $(CFLAGS) $(extra_CFLAGS) -c $< -o $@
|
|
|
|
# foo_CUSTOM lets us override all target rules for foo.so and foo.a
|
|
ifeq (,$($(module_name)_CUSTOM))
|
|
../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL)
|
|
$(CC) $(OBJ_ALL) $(LDFLAGS) $(plugins_LDFLAGS) $($(module_name)_LDFLAGS) -o $@
|
|
chmod a-x $@
|
|
|
|
../$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL)
|
|
rm -f $@
|
|
ar rc $@ $(OBJ_ALL)
|
|
$(RANLIB) $@
|
|
endif
|
|
|