Skip to content

Commit

Permalink
Add release target to create tarball for source releases
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel committed Mar 3, 2024
1 parent 5b1ae29 commit a0c2dfb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ var
builddir
__pycache__
.ref
ULWGL/ULWGL_VERSION.json
Makefile
ULWGL_VERSION.json
ULWGL_VERSION.json.in.tmp
Makefile
33 changes: 21 additions & 12 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PROJECT := ulwgl-launcher

# If this is changed to ULWGL (uppercase), `uninstall` target will also remove the SLR directory
INSTALLDIR ?= ulwgl

Expand All @@ -16,7 +18,7 @@ USERINSTALL ?= xfalse
all: version reaper ulwgl ulwgl-launcher


# Special case, do this inside the source directory for release source distribution
# Special case, do this inside the source directory for release distribution
ULWGL/ULWGL_VERSION.json: ULWGL/ULWGL_VERSION.json.in
$(info :: Updating $(@) )
cp $(<) $(<).tmp
Expand Down Expand Up @@ -93,36 +95,43 @@ reaper-install: reaper
install -Dm 755 $(OBJDIR)/$</$< -t $(DESTDIR)$(DATADIR)/$(INSTALLDIR)


.PHONY: $(OBJDIR)
$(OBJDIR):
@mkdir -p $(OBJDIR)
@mkdir -p $(@)


.PHONY: clean
clean:
$(info Cleaning "$(OBJDIR)" build directory)
@rm -rf -v $(OBJDIR) ULWGL/ULWGL_VERSION.json
$(info :: Cleaning source directory )
@rm -rf -v $(OBJDIR) ULWGL/ULWGL_VERSION.json ./$(RELEASEDIR) $(RELEASEDIR).tar.gz


RELEASEDIR := $(PROJECT)-$(shell git describe --abbrev=0)
$(RELEASEDIR):
mkdir -p $(@)

.PHONY: release
release: version
$(info Creating source distribution for release)
release: $(RELEASEDIR) | version
$(info :: Creating source distribution for release )
mkdir -p $(<)
rm -rf ULWGL/__pycache__
cp -r ULWGL flatpak subprojects Makefile.in configure.sh README.md LICENSE $(<)
tar -cvzf $(<).tar.gz $(<)


.PHONY: uninstall
# NEVER use a wildcard here
uninstall:
$(info Removing $(INSTALLDIR) files in $(DESTDIR)$(BINDIR))
$(info :: Removing $(INSTALLDIR) files in $(DESTDIR)$(BINDIR) )
@rm -rf -v --preserve-root=all $(DESTDIR)$(BINDIR)/ulwgl-run
$(info Removing $(INSTALLDIR) directory in $(DESTDIR)$(DATADIR))
$(info :: Removing $(INSTALLDIR) directory in $(DESTDIR)$(DATADIR) )
@rm -rf -v --preserve-root=all $(DESTDIR)$(DATADIR)/$(INSTALLDIR)


.PHONY: user-install
user-install:
$(info :: ---)
$(info :: Installed under user-only location "$(DATADIR)/$(INSTALLDIR)")
$(info :: To run you need to make sure "$(BINDIR)" is in your PATH)
$(info :: --- )
$(info :: Installed under user-only location "$(DATADIR)/$(INSTALLDIR)" )
$(info :: To run you need to make sure "$(BINDIR)" is in your PATH )


.PHONY: install
Expand Down

0 comments on commit a0c2dfb

Please sign in to comment.