8000 Put intermediate build files in BUILD directory by AlexanderplUs · Pull Request #149 · creytiv/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Put intermediate build files in BUILD directory #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ MKDIR := $(PREFIX)/share/re
CFLAGS += -Iinclude

MODMKS := $(patsubst %,src/%/mod.mk,$(MODULES))
SHARED := libre$(LIB_SUFFIX)
STATIC := libre.a
SHARED := $(BUILD)/libre$(LIB_SUFFIX)
STATIC := $(BUILD)/libre.a
PKG-CONFIG := $(BUILD)/libre.pc

include $(MODMKS)

Expand All @@ -74,19 +75,19 @@ ifneq ($(RANLIB),)
@$(RANLIB) $@
endif

libre.pc:
@echo 'prefix='$(PREFIX) > libre.pc
@echo 'exec_prefix=$${prefix}' >> libre.pc
@echo 'libdir=$${prefix}/lib' >> libre.pc
@echo 'includedir=$${prefix}/include/re' >> libre.pc
@echo '' >> libre.pc
@echo 'Name: libre' >> libre.pc
@echo 'Description: ' >> libre.pc
@echo 'Version: '$(VERSION) >> libre.pc
@echo 'URL: http://creytiv.com/re.html' >> libre.pc
@echo 'Libs: -L$${libdir} -lre' >> libre.pc
@echo 'Libs.private: -L$${libdir} -lre ${LIBS}' >> libre.pc
@echo 'Cflags: -I$${includedir}' >> libre.pc
$(PKG-CONFIG):
@echo 'prefix='$(PREFIX) > $(PKG-CONFIG)
@echo 'exec_prefix=$${prefix}' >> $(PKG-CONFIG)
@echo 'libdir=$${prefix}/lib' >> $(PKG-CONFIG)
@echo 'includedir=$${prefix}/include/re' >> $(PKG-CONFIG)
@echo '' >> $(PKG-CONFIG)
@echo 'Name: libre' >> $(PKG-CONFIG)
@echo 'Description: ' >> $(PKG-CONFIG)
@echo 'Version: '$(VERSION) >> $(PKG-CONFIG)
@echo 'URL: http://creytiv.com/re.html' >> $(PKG-CONFIG)
@echo 'Libs: -L$${libdir} -lre' >> $(PKG-CONFIG)
@echo 'Libs.private: -L$${libdir} -lre ${LIBS}' >> $(PKG-CONFIG)
@echo 'Cflags: -I$${includedir}' >> $(PKG-CONFIG)

$(BUILD)/%.o: src/%.c $(BUILD) Makefile $(MK) $(MODMKS)
@echo " CC $@"
Expand All @@ -100,17 +101,17 @@ $(BUILD): Makefile $(MK) $(MODMKS)

.PHONY: clean
clean:
@rm -rf $(SHARED) $(STATIC) libre.pc test.d test.o test $(BUILD)
@rm -rf $(SHARED) $(STATIC) $(PKG-CONFIG) test.d test.o test $(BUILD)


install: $(SHARED) $(STATIC) libre.pc
install: $(SHARED) $(STATIC) $(PKG-CONFIG)
@mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(LIBDIR)/pkgconfig \
$(DESTDIR)$(INCDIR) $(DESTDIR)$(MKDIR)
$(INSTALL) -m 0644 $(shell find include -name "*.h") \
$(DESTDIR)$(INCDIR)
$(INSTALL) -m 0755 $(SHARED) $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 0755 $(STATIC) $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 0644 libre.pc $(DESTDIR)$(LIBDIR)/pkgconfig
$(INSTALL) -m 0644 $(PKG-CONFIG) $(DESTDIR)$(LIBDIR)/pkgconfig
$(INSTALL) -m 0644 $(MK) $(DESTDIR)$(MKDIR)

uninstall:
Expand Down
0