Stef-Verniers

Stef-Verniers

Hello

I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But after two years, there is still so much to discover and knowledge I don’t have obtained yet.

I’m working on a private project now, using Elixir, but I find it kind of hard to learn this new step I want to implement in the private project: The setup of the Makefile

I looked at the Makefile of my job but this was such a huge difference with the examples I’ve came across on different sites. This makes it difficult to know what is necessary and what’s not.

The Makefile for my project should start the server, make sure the database is spinning, Docker containers are online and operating and that’s probably it for now.

How do I start? What’s important, what’s not?

Kind regards
Stef

Showing Posts 1 to 8

derek-zhou

derek-zhou

Makefiles are for old timers, like me. Yes, it is powerful; however, it comes with a lot of sharp edges and Makefile beyond certain size will be hopelessly unmaintainable.

Before opening a big can of worms, please ask yourself: “Do I really need a Makefile?”

colorfulcms

colorfulcms

For a first Makefile, I’d keep it as thin task aliases rather than real build logic. Start with .PHONY targets like deps (mix deps.get), db (docker compose up -d db), setup (depends on db, then mix ecto.setup) and server (depends on db, then iex -S mix phx.server). Since Docker Compose already handles starting the containers, you can add a healthcheck to the database service and use docker compose up -d --wait so the server target only runs once Postgres is actually ready. Remember that recipe lines need tabs, not spaces. If it grows beyond a handful of targets, mix aliases in mix.exs are a good alternative since they stay in Elixir.

mudasobwa

mudasobwa

Creator of Cure

You are after a simple bash script. Makefile is an overkill and misuse for this kind of task.

kristoffn

kristoffn

If your goal is to write tasks to set your project up, and not to learn the quirks of make, then I can highly recommend mise and mise tasks.

I’ve found it more usefull than make, because I can pin the tool versions (like databases) and mise installs them. Two advantages over make are the arguments and flags and the task descriptions. No need for a help task with awk magic, which in my experience go stale after a while as the Makefile changes and the flags make the invoked scripts tidier.

LostKobrakai

LostKobrakai

Another option imo is Introduction - Just Programmer's Manual. It’s like a makefile, but tries to actually be a task runner not a build system.

Stef-Verniers

Stef-Verniers OP

Hello,

Since I’m still learning a lot about Elixir, I’m not educated enough to answer in a proper way.
It’s just what I know because of my job. :confused:

Sorry for the late response!

Stef-Verniers

Stef-Verniers OP

That does look interesting. I’ll take a look at it!

Stef-Verniers

Stef-Verniers OP

Well yes, for local development, I can spin up my docker container from docker desktop en just type in the run phx.server command and those would be the most important tasks.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New
matthias.oberleitner
Hi, I’m evaluating Ash as a foundation for our future business applications. So far I love it, and there’s just one usecase I haven’t be...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews