-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 844 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 844 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
37
38
39
CC = gcc
CFLAGS = -Wall -Wextra -O2 -I. -Ideps/sxlist
LDFLAGS = -lSDL2 -lSDL2_ttf -lm
# Dependencies
LIST_SRC = deps/sxlist/dynamic_list.c
# Library
LIB_NAME = libsxui.a
LIB_OBJ = sxui.o dynamic_list.o
.PHONY: all clean lib example showcase
all: showcase example
# Compile dependency
dynamic_list.o: $(LIST_SRC)
$(CC) $(CFLAGS) -c $(LIST_SRC) -o dynamic_list.o
# Compile library core
sxui.o: sxui.c sxui.h
$(CC) $(CFLAGS) -c sxui.c -o sxui.o
# Create static library
$(LIB_NAME): $(LIB_OBJ)
ar rcs $(LIB_NAME) $(LIB_OBJ)
# Build Showcase binary
showcase_bin: showcase.c $(LIB_NAME)
$(CC) $(CFLAGS) showcase.c $(LIB_NAME) -o showcase_bin $(LDFLAGS)
# Build Example binary
example: example.c $(LIB_NAME)
$(CC) $(CFLAGS) example.c $(LIB_NAME) -o example $(LDFLAGS)
lib: $(LIB_NAME)
clean:
rm -f *.o $(LIB_NAME) showcase_bin example