Last active
December 10, 2022 07:29
-
-
Save Jammyjamjamman/9d7097932b391733df540fd8c51ff7bd to your computer and use it in GitHub Desktop.
makefile example #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Another simple make example. Creates 2 bins which include the same c file. | |
# Assumes e.g. you have main.c, main2.c, mylib.c and mylib.h. | |
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang. | |
CFLAGS = -g -Wall -fanalyzer # $(shell pkg-config --cflags openssl) | |
# LIBS=$(shell pkg-config --libs openssl) | |
# LDFLAGS = $(LIBS) | |
bins = myprogram1 myprogram2 | |
all: $(bins) | |
test1: mylib.o main.o | |
$(CC) -o myprogram1 $? | |
test2: mylib.o main2.o | |
$(CC) -o myprogram2 $? | |
.PHONY: clean | |
clean: | |
rm -f *.o $(bins) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A gtk4 example
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/examples/application1/Makefile.example