diff options
author | Simponic <loganthebean222@gmail.com> | 2020-08-04 23:36:21 -0600 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-08-04 23:36:21 -0600 |
commit | ebd81999b71ada201a316060fa47a7a66a277935 (patch) | |
tree | 930be8337e1144ba227bedb3e72e4473309c28e8 /src/Makefile | |
parent | b323ae0ca067deb0a48e3d9088160383d698a28f (diff) | |
download | simple3dengine-ebd81999b71ada201a316060fa47a7a66a277935.tar.gz simple3dengine-ebd81999b71ada201a316060fa47a7a66a277935.zip |
Added files
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..4a3fac7 --- /dev/null +++ b/src/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 -O0 --std=c99 -Wall -lSDL2_image -lm -g +# add header files here +HDRS := color.h defs.h fixed.h model.h triangle.h vertex.h model.h instance.h + +# add source files here +SRCS := main.c model.c instance.c + +# generate names of object files +OBJS := $(SRCS:.c=.o) + +# name of executable +EXEC := a.out + +# 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 |