Skip to content

Instantly share code, notes, and snippets.

@rpavlik
Created February 27, 2012 19:20
Show Gist options
  • Save rpavlik/1926441 to your computer and use it in GitHub Desktop.
Save rpavlik/1926441 to your computer and use it in GitHub Desktop.
Makefile to convert Mendeley on Linux PDF file references to equivalent ones (over dropbox) on Windows - for Qiqqa import.
#!/usr/bin/make
TARGET_DIR:=forwin
# All bib files with no spaces in their name.
FILES:=$(shell ls *.bib | grep "^[^ ]*$$")
CONVERTED_FILES:=$(patsubst %,$(TARGET_DIR)/%,$(FILES))
all: $(CONVERTED_FILES)
$(TARGET_DIR):
@echo Creating destination directory $(TARGET_DIR)
mkdir -p $(TARGET_DIR)
$(CONVERTED_FILES): $(TARGET_DIR)/% : % $(TARGET_DIR) $(MAKEFILE)
@echo Converting $< for Windows use
@sed --regexp-extended -e 's_home/rpavlik_C$$\\backslash$$:/Users/rpavlik_' $< > $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment