From 3c0a3b8413ee58a3e5678075c862e95f7c8395c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80=20=D0=9B=D1=8C=D0=B2=D0=BE=D0=B2?= Date: Mon, 27 Mar 2023 11:25:27 +0300 Subject: =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e25745c --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +# A simple Makefile for compiling small SDL projects + +# set the compiler +CC := gcc + +# set the compiler flags +CFLAGS := `sdl2-config --libs --cflags` -ggdb3 -O3 --std=c11 -Wall -lSDL2_image -lm +# add header files here +HDRS := + +# add source files here +SRCS := backup2.c + +# generate names of object files +OBJS := $(SRCS:.c=.o) + +# name of executable +EXEC := outp-t + +# default recipe +all: $(EXEC) + +showfont: showfont.c Makefile + $(CC) -o $@ $@.c $(CFLAGS) $(LIBS) + +glfont: glfont.c Makefile + $(CC) -o $@ $@.c $(CFLAGS) $(LIBS) + +# recipe for building the final executable +$(EXEC): $(OBJS) $(HDRS) Makefile + $(CC) -o $@ $(OBJS) $(CFLAGS) + +# recipe for building object files +#$(OBJS): $(@:.o=.c) $(HDRS) Makefile +# $(CC) -o $@ $(@:.o=.c) -c $(CFLAGS) + +# recipe to clean the workspace +clean: + rm -f $(EXEC) $(OBJS) + +.PHONY: all clean -- cgit v1.2.3