STX

Compile

🡸 lup:

pkg-config

get list of available pkgs:
$ pkg-config --list-all

get additional CFLAGS:
$ pkg-config --cflags[-only-[I|other]]
--cflags-only-I
  - only include dirs
--cflags-only-other
  - anything not include dirs

get lib linking flags:
$ pkg-config --libs

make

recipes are hard.

generally:

CC = [compiler]
CFLAGS = [CFLAGS]
LDFLAGS = [LDFLAGS]
LIBS = `pkg-config --libs [libs]`

%.o: %.c
	$(CC) $(CFLAGS) $< -c

[output]: [input]
	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@

CFLAGS

CFLAGS = \
	-O2 \
	-Wall \
	-pipe \
	-D_FORTIFY_SOURCE=2 \
	-fpie