gnu-make: Using individual files in a folder as dependencies and run rule on all filenames in folder - gnu-make

Suppose I have a file structure as follows:
code
├── configure
├── configure.in
├── Demo
│ ├── experiments
│ │ ├── 1.txt
│ │ ├── 2.txt
│ │ ├── 3.txt
│ │ ├── 4.txt
│ │ ├── 5.txt
│ │ └── 6.txt
| |___test.cpp
I am trying to create a rule that uses each one of the files in txt and creates the following files:
1.test
2.test
3.test
4.test
5.test
If I had the rule:
%.test: %.txt
do something
How do I run it on every file in experiments eg:
make *.test
and then run them individually eg:
.\*.test?
I really need help with this as I have thousands of files to process in this way.

You can use $(wildcard):
TEST_SOURCES = $(wildcard *.txt)
TEST_OUTPUT = $(patsubst %.txt,%.test,${TEST_SOURCES})
all: ${TEST_OUTPUT}

Related

font-icons.woff 404 not found with micro frontend

I'm developing a micro frontend, for this I use Webpack 5 Module Federation and ngx-build-plus builder on an Angular 14 application.
When I build my project I get the following files:
dist
├── my-webco
│ ├── 106.js
│ ├── 136.js
│ ├── 497.js
│ ├── .
│ ├── .
│ ├── .
│ ├── icon-font.woff
│ ├── icon-font.woff2
│ ├── index.html
│ ├── main.js
│ ├── remoteEntry.js
│ ├── style.css
So I want to import the main.js file into another application this way:
<script src="https://my-host/my-webco/main.js" type="text/javascript"></script>
<my-web-component></my-web-component>
The webcomponent works well but I have a 404 error on the font because my font is on the path "https://my-host/my-webco/font-icons.woff" and my application will load it on the path "https://my-host/font-icons.woff".
do you know where I can set up this path?

Jeykll file to import not found or unreadable: base

Ok, so, I somehow managed to break my jekyll website and I don't understand why. When I try to serve the site with jekyll I am prompted the following error:
/usr/lib/ruby/gems/2.7.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:190:in `rescue in convert': Error: File to import not found or unreadable: base. (Jekyll::Converters::Scss::SyntaxError)
on line 24:1 of main.scss
>> #import
^
My directory structure looks like so:
.
├── README.md
├── _site
│ ├── README.md
│ └── src
│ ├── assets
│ │ ├── posts
│ │ │ └── 202-07-23-about
│ │ │ └── avatar.png
│ │ └── screenshot.png
│ ├── general
│ │ └── 2020
│ │ └── 07
│ │ └── 23
│ │ └── about.html
│ └── index.html
└── src
├── assets
│ ├── images
│ ├── posts
│ │ └── 202-07-23-about
│ │ └── avatar.png
│ └── screenshot.png
├── _config.yml
├── css
│ └── main.scss
├── _includes
│ ├── footer.html
│ └── head.html
├── index.html
├── _layouts
│ ├── default.html
│ ├── page.html
│ └── post.html
├── _posts
│ └── 2020-07-23-about.md
├── _sass
│ ├── _base.scss
│ └── _syntax-highlighting.scss
└── _templates
├── draft
├── page
└── post
I assume it has trouble finding the _base.scss file? How can I tell it where it needs to look? It is pointing out the error is in line 24, but that doesn't really makes much sense. My main.scss looks like so:
---
# Only the main Sass file needs front matter (the dashes are enough)
---
#charset "utf-8";
// Our variables
$base-font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif;
$base-font-size: 12pt;
$small-font-size: $base-font-size * 0.875;
$base-line-height: 1.5;
$mono-font-family: 'Source Code Pro', Menlo, Monaco, Inconsolata;
$text-color: hsl(0, 0%, 25%);
$alt-color: hsl(0, 70%, 46%);
$alt-color-darker: darken($alt-color, 6%);
$article-bg-color: hsl(35, 36%, 95%);
$background-color: darken($article-bg-color, 6%);
$bg-color-darker: darken($article-bg-color, 15%);
$alt-text-color: darken($article-bg-color, 60%);
$subdued-border: rgba($bg-color-darker, 0.5);
// Import partials from `sass_dir` (defaults to `_sass`)
#import
"base",
"syntax-highlighting"
;
Can someone point out how I can fix this problem?
Your project directory structure looks a little odd, since you use the unconventional organisation within the src folder.
I see 2 simple solutions:
1. Move the contents out of the src folder into the root
That is the expected structure and you don't run into further configuration issues. It will just work because everything is where it is supposed to be.
2. Configure sass in _config.yml
In your _config.yml add the following sections:
sass:
sass_dir: src/_sass
and the jekyll-sass-converter should be able to find it.
Have a look at the Jekyll Assets Docs for further information.

Gatsby/NextJS: group pages by domains

I'm trying to understand how to migrate to Gatsby/NextJS our structure.
src
├── scripts
├── components
├── domains
│ ├── ca.cdn.domain-1.com
│ │ ├── global
│ │ └── pages
│ │ │ ├── page.html
│ │ │ └── page-2.html
│ ├── m.cdn.domain-2.de
│ │ ├── global
│ │ └── pages
│ │ │ ├── page.html
│ │ │ └── page-2.html
page.html files can have different html templates, but sharing some common components from src.
Currently, we generate static pages per domain with Gulp. Tried Gatsby today and pages can be only in src folder. Any suggestions on how to use Gatsby/NextJS with multiple domains in 1 repo?
Also more detailed I described the question here for NextJS.

How to set up webpack in AngularJS ASP.NET MVC 5 application?

I have this project currently running on ASP.NET MVC and using AngularJS for the front end.
I am using bower and gulp but want to migrate away to use new tooling, if possible webpack.
I have started the migration process, where all bower packages have been moved to package.json.
I need help figuring out how to set up webpack. And how the changes will affect the .NET Bundle.Config.cs file in App_Start.
Basic Project structure:
MyApp/
├── App_Start/
│ └── BundleConfig.cs
│
├── Controllers/
│ └── HomeController.cs
│
├── Content/
│ └── node_modules/
│ └── package.json
│
├── ng-app/
│ └── app.js
│ └── run.js
│ └── routes.js
│ └── controllers/
│ └── homeCtrl.js
│
├── ng-views/
│ └── home.html
│
└── Views/
├── Home/
│ └── Index.cshtml
│
└── Shared/
└── _Layout.cshtml
If anyone has some pointers/ articles/ guides, whatever help is welcomed.
If you need more info on my setup please ask.

Add a module/library to meta-toolchain-qt5 sdk

I am trying to add qtcharts to meta-toolchain-qt5. My question is to which
recipes/files should I add qtcharts to have qtcharts on meta-toolchain-qt5
sdk?
I need to compile my program with qmake at
/opt/myimage/2.1.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
I am not sure where should I put the qtcharts. Under meta-qt5 or
meta-myapplication/recipes-qt or somewhere else
here is poky directory:
poky$ tree -L 2
├── bitbake
│ └── ...
├── build
│ └── ...
├── meta
│ └── ...
├── meta-freescale-distro
│ └── ...
├── meta-fsl-arm
│ └── ...
├── meta-myqtapplication
│ ├── classes
│ ├── conf
│ ├── DOC
│ ├── licenses
│ ├── meta-patch
│ ├── README.md
│ ├── recipes-apps
│ ├── recipes-bsp
│ ├── recipes-connectivity
│ ├── recipes-core
│ ├── recipes-kernel
│ └── recipes-qt
├── meta-openembedded
│ └── ...
├── meta-poky
│ └── ...
├── meta-qt5
│ ├── classes
│ ├── conf
│ ├── COPYING.MIT
│ ├── files
│ ├── lib
│ ├── licenses
│ ├── README
│ ├── recipes-connectivity
│ ├── recipes-devtools
│ └── recipes-qt
├── meta-selftest
├── meta-skeleton
├── meta-yocto
├── meta-yocto-bsp
First of all, In Yocto/Bitbake while You are using meta-toolchain-qt5 recipe for generating SDK, You need to apply qtcharts as nativesdk package into nativesdk-packagegroup-qt5-toolchain-host.bb recipe, moving recipe to another localisation like poky/ will not apply them as rdepends package.
I see that qtcharts recipe is not available as nativesdk package, so You can extend BBCLASSEXTEND variable for this purpose, or use nativesdk class file.

Resources