aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 134d617b0264ff9bd66abdc8960358e9ddd64d47 (plain) (blame)
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
# ----------------------------------------
# Compiler and linker options
# ----------------------------------------

# Name of the executables to be generated
EXEC      := examples/ini_file_read \
             examples/ini_file_search \
			 examples/ini_file_create

# Library files
LIB_FILES := ini_file.c ini_file.h

# Flags for compiler
CFLAGS    := -W -Wall -Wextra -pedantic -Wconversion -Werror -flto -std=c89 -O2

# ----------------------------------------
# Compilation and linking rules
# ----------------------------------------

all: $(EXEC)

%: %.c $(LIB_FILES) Makefile
	$(CC) $(filter %.c,$^) -o $@ $(CFLAGS)

# ----------------------------------------
# Script rules
# ----------------------------------------

clean:
	$(RM) $(EXEC)

remade: clean all

.PHONY: all clean remade

# ----------------------------------------