Bladeren bron

refine make system for packages

Hal Emmerich 3 jaren geleden
bovenliggende
commit
1c4edc13b7

+ 8 - 7
makefile

@@ -23,13 +23,9 @@ endif
 OUTNAME=PrawnOS-$(PRAWNOS_SUITE)-c201.img
 BASE=$(OUTNAME)-BASE
 
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
 
-PRAWNOS_ROOT := $(shell pwd)
-PBUILDER_CHROOT=$(PRAWNOS_ROOT)/build/prawnos-pbuilder-armhf-base.tgz
-PBUILDER_RC=$(PRAWNOS_ROOT)/resources/BuildResources/pbuilder/prawnos-pbuilder.rc
-
-# Otherwise errors are ignored when output is piped to tee:
-SHELL=/bin/bash -o pipefail
 
 #Usage:
 #run make image
@@ -123,6 +119,11 @@ filesystem:
 	[ -f $(BASE) ] || ./scripts/buildFilesystem.sh $(KVER) $(DEBIAN_SUITE) $(BASE) 2>&1 | tee build/logs/fs-log.txt
 
 
+#:::::::::::::::::::::::::::::: packages ::::::::::::::::::::::::::::::::
+.PHONY: packages
+packages:
+	cd packages && $(MAKE)
+
 #:::::::::::::::::::::::::::::: image management ::::::::::::::::::::::::::
 
 .PHONY: kernel_inject
@@ -152,7 +153,7 @@ image:
 pbuilder_create:
 	$(MAKE) $(PBUILDER_CHROOT)
 
-$(PBUILDER_CHROOT): $(PBUILDER_RC)
+$(PBUILDER_CHROOT):
 	pbuilder create --basetgz $(PBUILDER_CHROOT) --configfile $(PBUILDER_RC)
 
 #TODO: should only update if not updated for a day

+ 7 - 3
packages/filesystem/font-source-code-pro/makefile

@@ -1,7 +1,11 @@
-all: font-source-code-pro-deb
+#import all shared make vars
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
 
-.PHONY: font-source-code-pro-deb
-font-source-code-pro-deb:
+VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
+
+font-source-code-pro_$(VERSION)_all.deb:
+	@echo Building $@
 	cd src/; debuild -us -uc
 
 .PHONY: clean

+ 4 - 1
packages/filesystem/filesystem.make → packages/filesystem/makefile

@@ -1,3 +1,6 @@
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
+
 SUBDIRS = $(shell ls -d */)
 
 all:
@@ -9,4 +12,4 @@ all:
 clean:
 	for dir in $(SUBDIRS) ; do \
 		make clean -C  $$dir ; \
-	done
+	done

+ 7 - 7
packages/filesystem/xsecurelock/makefile

@@ -1,12 +1,12 @@
-SHELL := /bin/bash
-PRAWNOS_ROOT := $(shell cd ../../../; pwd)
-PBUILDER_CHROOT=$(PRAWNOS_ROOT)/build/prawnos-pbuilder-armhf-base.tgz
-PBUILDER_RC=$(PRAWNOS_ROOT)/resources/BuildResources/pbuilder/prawnos-pbuilder.rc
+#import all shared make vars
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
 
-all: xsecurelock-deb
 
-.PHONY: xsecurelock-deb
-xsecurelock-deb:
+VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
+
+xsecurelock_$(VERSION)_armhf.deb:
+	@echo Building $@
 	cd src/; pdebuild --configfile $(PBUILDER_RC) \
                     --buildresult .. \
                     -- \

+ 5 - 0
packages/initramfs/makefile

@@ -0,0 +1,5 @@
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
+
+all:
+	@echo TODO

+ 5 - 0
packages/kernel/makefile

@@ -0,0 +1,5 @@
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
+
+all:
+	@echo TODO

+ 15 - 0
packages/makefile

@@ -0,0 +1,15 @@
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
+
+SUBDIRS = $(shell ls -d */)
+
+all:
+	for dir in $(SUBDIRS) ; do \
+		make -C  $$dir ; \
+	done
+
+
+clean:
+	for dir in $(SUBDIRS) ; do \
+		make clean -C  $$dir ; \
+	done

+ 6 - 0
packages/packaging-readme.md

@@ -42,6 +42,12 @@ make
 ```
 the resulting .deb will be in that same folder when the build is complete
 
+All packages can be built by running
+```
+make
+```
+from the packages directory
+
 ### Uploading packages
 New packages, and package updates can upload to `deb.prawnos.com` by maintainers
 first by building and then running

+ 1 - 0
scripts/buildFilesystem.sh

@@ -248,6 +248,7 @@ chroot $outmnt apt install -y libinput-tools xdotool build-essential
 PRAWN_ROOT=$(pwd)
 cd $XSECURELOCK_PATH && make
 cd $PRAWN_ROOT
+#TODO: replace with cd packages && make install $outmnt/var/cache/apt/archives/
 cp $XSECURELOCK_PATH/xsecurelock_*_armhf.deb $outmnt/var/cache/apt/archives/
 chroot $outmnt apt install -y -d xsecurelock
 

+ 11 - 0
scripts/common.mk

@@ -0,0 +1,11 @@
+ifndef COMMON_MK
+COMMON_MK := 1
+
+#Place all shared make vars below
+#=========================================================================================
+PBUILDER_CHROOT := $(PRAWNOS_ROOT)/build/prawnos-pbuilder-armhf-base.tgz
+PBUILDER_RC := $(PRAWNOS_ROOT)/resources/BuildResources/pbuilder/prawnos-pbuilder.rc
+# Otherwise errors are ignored when output is piped to tee:
+SHELL := /bin/bash -o pipefail
+#=========================================================================================
+endif # COMMON_MK