Compare commits

..
Author SHA1 Message Date
e7da317575
projects-dir.mk: Resolve JWB_SCRIPT_DIR from JWBDIR
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m43s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m0s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m45s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m49s
CI / Packaging test (push) Successful in 0s
JWB_SCRIPT_DIR bypasses $(JWBDIR) for its scripts candidate, re-assembling
./$(JWBDIR_NAME)/scripts from the bare name. That works, but is redundant
resolution machinery which should be removed per se.

Resolve the scripts directory from $(JWBDIR) instead. Aside from
simplifying, that fixes the resolution when projects-dir.mk is included
from Makefiles other than projects-dir-miminimal.mk, and  complements work
to commit f3f0ef10ca which also aims at allowing to run make from a
bind-mounted dependency closure of repositories.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:49:26 +02:00
673953e56c
.gitignore: Run make gitignore
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m19s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m50s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m31s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m37s
CI / Packaging test (push) Successful in 0s
Update .gitignore by running "make gitignore. Add a couple of jw-pkg-
specific build-artifacts to GITIGNORE_PATTERNS_END before:

  .cache-projects.mk
  make/ssh-wrapper.sh

Also cancel the automatic inclusion of file paths containing jw-pkg with
an empty GITIGNORE_PATTERNS_TOP.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:09:26 +02:00
f82bca220e
jw-pkg-create-project.sh: Use make gitignore
jw-pkg-create-project.sh contains its own .gitignore template, which is
redundant to the new gitignore mechanism. Replace it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:09:25 +02:00
bf636f8b71
topdir.mk: Add target gitignore
Add a target gitignore to topdir.mk, which blasts jw-pkg's default idea of
how .gitignore should look like into $(TOPDIR)/.gitignore. It's not a
prerequisite of any other target, because it's not meant to run
automatically. The idea is to keep some central maintenance of what should
be in there from jw-pkg's perspective, make it convenvient to update, but
leave the final decision to the commiter of any project using the
machinery.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:09:25 +02:00
bf3484c2c9
topdir.mk: Add JW_PKG_TMPL_XXX
Add variables to shorten typical invocations of "jw-pkg project update
--format tmpl", and use them in py-topdir.mk

 JW_PKG_TMPL_SEARCH_PATH
 JW_PKG_TMPL_UPDATE

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-13 23:09:25 +02:00
6 changed files with 126 additions and 51 deletions

63
.gitignore vendored
View file

@ -1,16 +1,55 @@
dist
bin/*.sh
bin/*.py
*.done
*.a
*.dep.mk
*.dist
*.done
*.jw-secret
*.jw-secret-file
*.ldscript
*.o
*.old
*.orig
*.out
test-out.txt
make/.cache.mk
make/jw-pkg.pc
minimal-to-master.sh
pkg-build.dist
pkgconfig/
rebase.sh
__pycache__
*.pc
*.pyc
*.rep
*.secret
*.so
*.so.*
*.swp
*_generated_*
*tmp*
*~
-test-out.txt
.cache-project.mk
.exrc
.feedfs_history
.gdb_history
.jw-agit
.mypy_cache
.ruff_cache
__init__.py
__pycache__
bin/*.bat
bin/*.pl
bin/*.pm
bin/*.py
bin/*.sh
bin/*.tcl
conftest.py
core
dist
ld-*.conf
local.conf
local.mk
local.mk
local.yaml
make/*.pc
mkspec.sh
pr-descr*.txt
pre-local.mk
pyproject.toml
pyrightconfig.json
!*.jw-tmpl
!*.tmpl
.cache-projects.mk
make/ssh-wrapper.sh

View file

@ -4,12 +4,16 @@ PKG_UPLOAD_URLPREFIX ?= rsync_ssh://$(JANWARE_USER)@pkg.janware.com:/srv/da
all:
all: cache-projects
GITIGNORE_PATTERNS_TOP =
GITIGNORE_PATTERNS_END = .cache-projects.mk make/ssh-wrapper.sh
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/topdir.mk
include $(JWBDIR)/make/srcdist.mk
include $(JWBDIR)/make/git-cvs-bridge.mk
include $(JWBDIR)/make/py-topdir.mk
clean: clean.pkgconfig
clean.pkgconfig:
rm -rf pkgconfig

55
conf/templates/gitignore Normal file
View file

@ -0,0 +1,55 @@
{top}
*.a
*.dep.mk
*.dist
*.done
*.jw-secret
*.jw-secret-file
*.ldscript
*.o
*.old
*.orig
*.out
*.pc
*.pyc
*.rep
*.secret
*.so
*.so.*
*.swp
*_generated_*
*tmp*
*~
-test-out.txt
.cache-project.mk
.exrc
.feedfs_history
.gdb_history
.jw-agit
.mypy_cache
.ruff_cache
__init__.py
__pycache__
bin/*.bat
bin/*.pl
bin/*.pm
bin/*.py
bin/*.sh
bin/*.tcl
conftest.py
core
dist
ld-*.conf
local.conf
local.mk
local.mk
local.yaml
make/*.pc
mkspec.sh
pr-descr*.txt
pre-local.mk
pyproject.toml
pyrightconfig.json
!*.jw-tmpl
!*.tmpl
{end}

View file

@ -19,8 +19,7 @@ clean: clean.topdir
clean.topdir: clean.py-check
pyproject.toml:
$(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered projects create-file --format tmpl \
--template-name $@ --search-path $(JW_PKG_CONF_BASE_DIR)/templates --field mypypath='$(MYPY_PATH_DIRECTIVE)' $(PROJECT) > $@.tmp
$(JW_PKG_TMPL_UPDATE) $@ --field mypypath='$(MYPY_PATH_DIRECTIVE)' $(PROJECT) > $@.tmp
mv $@.tmp $@
pyrightconfig.json:

View file

@ -95,6 +95,13 @@ ifneq ($(SUBDIRS_TO_ITERATE),)
endif
endif
JW_PKG_TMPL_SEARCH_PATH ?= $(JW_PKG_CONF_BASE_DIR)/templates
JW_PKG_TMPL_UPDATE ?= $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format unaltered \
projects create-file --format tmpl --search-path $(subst $(space),:,$(JW_PKG_TMPL_SEARCH_PATH)) --template-name
GITIGNORE_PATTERNS_TOP ?= $(PROJECT)
GITIGNORE_PATTERNS_END ?= $(addprefix !,$(shell git ls-files 2>/dev/null | grep "\(\b$(PROJECT)\b\|__init__.py\)" | xargs))
all: topdir config
test: all
@ -307,3 +314,10 @@ Makefile: ;
%: $(TD_COPY_SRC)/% $$(foreach path,$$(TD_COPY_SRC_PATH),$$(wildcard $$(addprefix $$(path)/,$$@))) $$(wildcard $$@.*)
cat $^ > $@.tmp
mv $@.tmp $@
gitignore:
$(JW_PKG_TMPL_UPDATE) gitignore --field-keys top,end \
$(addprefix --field top=,$(GITIGNORE_PATTERNS_TOP)) \
$(addprefix --field end=,$(GITIGNORE_PATTERNS_END)) \
--field-separator='%n' $(PROJECT) | grep -v '^[[:space:]]*$$' > .gitignore.tmp
mv .gitignore.tmp .gitignore

View file

@ -97,42 +97,6 @@ cat_make_project_conf()
EOT
}
cat_gitignore()
{
cat <<-EOT
*.done
*.dist
*.dep.mk
.cache-project.mk
*.o
*.so.*
*.so
*.a
*.rep
ld-*.conf
*.ldscript
*.pc
$name
*_generated_*
*.secret
local.mk
.gdb_history
dist
mkspec.sh
*.out
*.orig
*.old
.feedfs_history
.exrc
*.swp
*tmp*
__init__.py
__pycache__
pyproject.toml
pyrightconfig.json
EOT
}
# ---------------------- here we go
myname=`basename $0`
@ -193,7 +157,7 @@ cat_make_Makefile > make/Makefile
cat_VERSION > VERSION
cat_make_proj_mk > make/proj.mk
cat_make_project_conf > make/project.conf
cat_gitignore > .gitignore
make gitignore
log Successfully created project template \"$name\".