-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 758 Bytes
/
Makefile
File metadata and controls
34 lines (24 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# A simple Makefile for compiling small projects
# set the compiler
CC := g++
# set the compiler flags
CPPFLAGS := -std=c++17 -Wall -Wpedantic `sdl2-config --cflags --libs` -lSDL2_image -lm -I include/
# add header files here
HDRS := FastNoiseLite.h
# add source files here
SRCS := main.cpp
# generate names of object files
OBJS := $(SRCS:.cpp=.o)
# name of executable
EXEC := fastnoise
# default recipe
all: clean $(EXEC)
# recipe for building the final executable
$(EXEC): $(OBJS) $(HDRS) Makefile
$(CC) -o $@ $(OBJS) $(CPPFLAGS)
# recipe for building object files
#$(OBJS): $(@:.o=.c) $(HDRS) Makefile
# $(CC) -o $@ $(@:.o=.c) -c $(CFLAGS)
# recipe to clean the workspace
clean:
rm -f $(wildcard *.o) $(EXEC)