Skip to content
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

修复linux下make时无open命令的问题 #110

Merged
merged 1 commit into from
Nov 16, 2023
Merged
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
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