-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (27 loc) · 815 Bytes
/
Makefile
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
37
38
CC = gcc
OUTPUT = build
NAME = gbtime
EXE = $(OUTPUT)/$(NAME).exe
BACKEND-SRC = $(basename $(wildcard source/emulator/*.c) $(wildcard source/ESGL/*.c))
BACKEND-OBJ = $(addprefix $(OUTPUT)/,$(addsuffix .o,$(notdir $(BACKEND-SRC))))
BACKEND = $(OUTPUT)/libGamma.a
SRC = source/main.c
FLAGS = -O2 -std=c89
LIBS = $(BACKEND) -lopengl32 -lgdi32 -lShcore
INCLUDE = -I"include"
all: $(OUTPUT) $(BACKEND) $(EXE) run
run: $(EXE)
./$(EXE)
clean:
rm $(OUTPUT)/**
$(EXE): $(SRC) $(BACKEND)
$(CC) $(FLAGS) $(INCLUDE) $(SRC) $(LIBS) -o $@
$(BACKEND): $(BACKEND-OBJ)
$(AR) -rcs $@ $^
@strip --strip-unneeded $@
$(OUTPUT)/%.o: source/emulator/%.c
$(CC) $(FLAGS) $(INCLUDE) $(BACKEND-LIBS) $^ -c -o $@
$(OUTPUT)/%.o: source/esgl/%.c
$(CC) $(FLAGS) $(INCLUDE) $(BACKEND-LIBS) $^ -c -o $@
$(OUTPUT):
mkdir $(OUTPUT)