Skip to content

Commit

Permalink
Try to make the build process a little smoother.
Browse files Browse the repository at this point in the history
This change keeps VERSION stored in git so that checking out a
particular git commit will allow you to build from that version without
having to modify anything by hand.
  • Loading branch information
jordansissel committed Aug 4, 2021
1 parent 051fcbd commit b89ec98
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.so*
*.1
libxdo.pc
xdo_version.h
xdotool
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ post-install:
|| echo "Failed running 'ldconfig'. Maybe you need to be root?"; \
fi


.PHONY: installprog
installprog: xdotool
install -d $(DINSTALLBIN)
Expand Down Expand Up @@ -124,7 +123,7 @@ uninstall:

.PHONY: clean
clean:
rm -f *.o xdotool xdotool.static xdotool.1 xdotool.html xdo_version.h \
rm -f *.o xdotool xdotool.static xdotool.1 xdotool.html \
libxdo.$(LIBSUFFIX) libxdo.$(VERLIBSUFFIX) libxdo.a libxdo.pc

xdo.o: xdo.c xdo_version.h
Expand Down Expand Up @@ -180,6 +179,11 @@ xdotool.html: xdotool.pod
.PHONY: package
package: test-package-build create-package create-package-deb

.PHONY: update-version
update-version:
rm -f VERSION
make VERSION xdo_version.h

.PHONY: package-deb
package-deb: test-package-build create-package-deb

Expand All @@ -201,12 +205,8 @@ xdo_version.h: VERSION
VERSION:
sh version.sh --shell > $@

.PHONY: pre-create-package
pre-create-package:
rm -f VERSION xdo_version.h

.PHONY: create-package
create-package: pre-create-package VERSION xdo_version.h libxdo.pc
create-package: xdo_version.h libxdo.pc
@NAME=xdotool-$(VERSION); \
echo "Creating package: $$NAME"; \
mkdir $${NAME}; \
Expand All @@ -217,15 +217,16 @@ create-package: pre-create-package VERSION xdo_version.h libxdo.pc

# Make sure the package we're building compiles.
.PHONY: test-package-build
test-package-build: NAME=xdotool-$(VERSION)
test-package-build: create-package
@NAME=xdotool-$(VERSION) && \
echo "Testing package $$NAME" && \
tar -zxf $${NAME}.tar.gz && \
make -C $${NAME} && \
make -C $${NAME} docs && \
make -C $${NAME} test && \
echo "Package ready: $${NAME}"; \
rm -rf $${NAME}
echo "Testing package $(NAME)"
tar -zxf $(NAME).tar.gz
make -C ./$(NAME)
make -C ./$(NAME) docs
make -C ./$(NAME) install DESTDIR=$(NAME)/install-test/ LDCONFIG=:
make -C ./$(NAME) test
rm -rf ./$(NAME)
echo "Package ready: $(NAME)";


### Build .deb packages for xdotool. The target 'create-package-deb' will
Expand Down
3 changes: 3 additions & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MAJOR="3"
RELEASE="20210804"
REVISION="1"
4 changes: 4 additions & 0 deletions xdo_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef _VERSION_H_
#define _VERSION_H_
static const char *XDO_VERSION = "3.20210804.1";
#endif /* ifndef _VERSION_H */

0 comments on commit b89ec98

Please sign in to comment.