-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) · 756 Bytes
/
Makefile
File metadata and controls
36 lines (25 loc) · 756 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
35
36
## Short makefile to compile my Go engine
## You SHOULD NOT modify the parameters below
## Compiler to use - do not change
CC = gcc
## Compiler flags - do not change
CFLAGS = -static -Wall -Wextra -Werror -pedantic -O3
## Linking flags - do not change
LDFLAGS = $(CFLAGS)
## The name of the binary (executable) file - do not change
TARGET ?= goteam
## Build the target by default
all: $(TARGET)
## You can change everything below to make your target compile,
## link, clean or do anything else you'd like.
#grab all source files from src
SRCS = $(wildcard src/*.c)
OBJS = $(SRCS:.c=.o)
#link the executable
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
#compile rule
src/%.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) src/*.o