Skip to content

Commit

Permalink
reset Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
efremropelato committed Nov 6, 2024
1 parent 8d6c8d5 commit b43081d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ USER=$(shell id -u -n)
TIME=$(shell date)
JR_HOME=jr

ifndef XDG_DATA_DIRS
ifeq ($(OS), Windows_NT)
detectedOS := Windows
else
Expand All @@ -12,16 +13,36 @@ endif

ifeq ($(detectedOS), Darwin)
JR_SYSTEM_DIR="$(HOME)/Library/Application Support"
JR_USER_DIR="$(HOME)/.local/share"
endif
ifeq ($(detectedOS), Linux)
ifeq ($(detectedOS), Linux)
JR_SYSTEM_DIR="$(HOME)/.config"
JR_USER_DIR="$(HOME)/.local/share"
endif
ifeq ($(detectedOS), Windows_NT)
JR_SYSTEM_DIR="$(LOCALAPPDATA)"
endif
else
JR_SYSTEM_DIR=$(XDG_DATA_DIRS)
endif

ifndef XDG_DATA_HOME
ifeq ($(OS), Windows_NT)
detectedOS := Windows
else
detectedOS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
endif

ifeq ($(detectedOS), Darwin)
JR_USER_DIR="$(HOME)/.local/share"
endif
ifeq ($(detectedOS), Linux)
JR_USER_DIR="$(HOME)/.local/share"
endif
ifeq ($(detectedOS), Windows_NT)
JR_USER_DIR="$(LOCALAPPDATA)" //@TODO
endif
else
JR_USER_DIR=$(XDG_DATA_HOME)
endif

hello:
@echo "JR,the JSON Random Generator"
Expand Down Expand Up @@ -89,4 +110,4 @@ install:
install build/jr /usr/local/bin

all: hello install-gogen generate compile
all_offline: hello generate compile
all_offline: hello generate compile

0 comments on commit b43081d

Please sign in to comment.