You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/plug-in/Makefile.app_module

50 lines
1.1 KiB

include ../../Makefile.defs
ldflags = $(LIB_LD_FLAGS) $(module_ldflags)
cflags = -I ../.. $(CPP_FLAGS) $(module_cflags)
app_module_dir = ../../lib/apps
lib_name = $(plug_in_name).so
lib_full_name = $(app_module_dir)/$(lib_name)
srcs = $(wildcard *.cpp)
hrds = $(wildcard *.h)
objs = $(srcs:.cpp=.o)
depends = $(srcs:.cpp=.d)
.PHONY: all
all: $(extra_target)
-@$(MAKE) deps && \
$(MAKE) $(lib_full_name)
.PHONY: clean
clean:
-@rm -f $(objs) $(depends) $(lib_name)
.PHONY: deps
deps: $(depends)
.PHONY: install
install: $(lib_full_name) $(extra_install)
cd ../.. ; \
$(INSTALL-TOUCH) $(modules-prefix)/$(modules-dir)apps/$(lib_name) ; \
$(INSTALL-MODULES) lib/apps/$(lib_name) $(modules-prefix)/$(modules-dir)apps
%.d: %.cpp Makefile ../Makefile.app_module
g++ -MM $< $(cflags) > $@
%.o: %.cpp %.d
g++ $(cflags) -c $< -o $@
$(lib_full_name): $(lib_name)
cp $(lib_name) $(lib_full_name)
$(lib_name): $(objs) Makefile
g++ -o $(lib_name) $(objs) $(module_extra_objs) $(ldflags)
ifeq ($(lib_full_name),$(MAKECMDGOALS))
include $(depends)
endif