TOPDIR = .. include $(TOPDIR)/rules.mk PXX_AMODULES = \ pxx_exception PXX_MODULES = \ pxx_common \ pxx_sys_error \ pxx_allocator \ pxx_malloc_allocator \ pxx_heap \ pxx_heap_allocator \ pxx_default_allocator \ pxx_chunk_allocator_block_header \ pxx_chunk_allocator \ pxx_buffer \ pxx_fd_buffer \ pxx_stream \ pxx_binary_stream \ pxx_fd_binary_stream \ pxx_text_stream \ pxx_fd_text_stream \ pxx_string \ pxx_vector \ pxx_sock_addr \ pxx_stream_socket PXX_AHEADERS = $(PXX_AMODULES:=.hh) PXX_SOURCES = $(PXX_MODULES:=.cc) PXX_HEADERS = $(PXX_MODULES:=.hh) PXX_IHEADERS = $(PXX_MODULES:=.ih) PXX_OBJECTS = $(PXX_MODULES:=.o) ALL_SOURCES = $(PXX_SOURCES) DEPS = $(ALL_SOURCES:.cc=.dep) LIBPXX = libp++.a DISTFILES = Makefile DISTFILES += $(ALL_SOURCES) DISTFILES += $(PXX_HEADERS) DISTFILES += $(PXX_IHEADERS) DISTFILES += $(PXX_AHEADERS) all:: $(LIBPXX) $(LIBPXX): $(PXX_OBJECTS) ar cru $@ $^ install:: all mkdir -p -m 0755 $(INSTALL_DIR)/lib install -m 0644 $(LIBPXX) $(INSTALL_DIR)/lib/ mkdir -p -m 0755 $(INSTALL_DIR)/include/libp++ $(foreach f, $(PXX_HEADERS) $(PXX_IHEADERS) $(PXX_AHEADERS), \ install -m 0644 $(f) $(INSTALL_DIR)/include/libp++/ ; ) uninstall:: all { \ cd $(INSTALL_DIR)/lib \ rm $(LIBPXX) \ } clean:: rm -f $(LIBPXX) *.o *.dep -include $(DEPS)