From 2c5a5f7679a5f450e483fdedc99c80622f260a4d Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Fri, 27 Jan 2023 00:05:24 +0100 Subject: Init commit. --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1b36766 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +NAME=poc +CC = gcc +CFLAGS = -Isrc +# Standard compliance +CFLAGS += -std=c99 -pedantic + +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/man + +all: bin/$(NAME) + +debug: CFLAGS += -Wall -DEBUG -g +debug: bin/$(NAME) + +sources = $(wildcard src/*.c) +objects = $(patsubst src/%.c, bin/%.o, $(sources)) + +bin/$(NAME): $(objects) + mkdir -p $$(dirname $@) + $(CC) $(CFLAGS) $^ -o $@ $(LIBS) + +bin/%.o: src/%.c + mkdir -p $$(dirname $@) + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -rf bin/ + +.PHONY: clean -- cgit v1.2.3