Skip to content

Commit

Permalink
Merge pull request #110 from Alex-Beng/public-dev
Browse files Browse the repository at this point in the history
修复linux下make时无open命令的问题
  • Loading branch information
polossk authored Nov 16, 2023
2 parents 3ff90f2 + 9ef51e2 commit 9b10c16
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ makecls: $(MAIN).dtx
ifeq ($(OS), Windows_NT)
PLATFORM = Windows
else
ifeq ($(shell uname), Darwin)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
PLATFORM = MacOS
else
PLATFORM = Unix-Like
endif
ifeq ($(UNAME), Linux)
PLATFORM = Linux
endif
endif

Expand All @@ -32,10 +34,18 @@ ifeq ($(PLATFORM), Windows)
OPEN = cmd /c start
CLOSE = cmd /c taskkill /im Acrobat.exe /t /f
else
RM = rm -rf
OPEN = open
PID = $$(ps -ef | grep AdobeAcrobat | grep -v grep | awk '{print $$2}')
CLOSE = kill -9 $(PID)
ifeq ($(PLATFORM), MacOS)
RM = rm -rf
OPEN = open
PID = $$(ps -ef | grep AdobeAcrobat | grep -v grep | awk '{print $$2}')
CLOSE = kill -9 $(PID)
endif
ifeq ($(PLATFORM), Linux)
RM = rm -rf
OPEN = xdg-open
PID = $$(ps -ef | grep evince | grep -v grep | awk '{print $$2}')
CLOSE = kill -9 $(PID)
endif
endif

texsample: $(MAIN)-sample.tex
Expand Down

0 comments on commit 9b10c16

Please sign in to comment.