-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
58 lines (45 loc) · 1.07 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
comp = gcc #compilador
stdlibs = -lm -lpthread
sdl = -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf
flagsChatas = -Wall -pedantic -ansi
outros= -D_GNU_SOURCE=1 -D_REENTRANT
head = lib-headers/*.h
lib = lib/*.c lib/*/*.c
srcDir = src
source = $(srcDir)/*.c $(srcDir)/*/*.c
bin = exe
executavel = .out
testes = testes
comandos = $(comp) -o $(bin)$(executavel) $(lib) $(source) $(stdlibs) $(sdl)
exec: compilar
./$(bin)$(executavel)
@make cleanSimples --no-print-directory
@echo
compilar:
@echo
$(comandos)
@echo
chato:
$(comandos) $(chatoFlags)
cleanSimples:
@echo
rm -rf `find -name '*.o'; find -name '$(bin)'; find -name '*$(executavel)'`
clean: cleanSimples
rm -rf `find -name '*~'; find -name 'core'; find -name 'a.out'`
@echo
cleanCompleto:
@echo
rm -rf `find -name '*.o' -o -name '*.exe' -o -name '*.bak' -o -name '*.c~' -o -name 'core' -o -name 'a.out' -o -name '$(bin)' -o -name 'repetir'`
@echo
limpa: clean
@
limpar: clean
@
%:
@echo
rm -rf $@
@echo
$(comp) -o $(testes)/$@$(executavel) lib/terminal.c $(testes)/$@.c
@echo
./$(testes)/$@$(executavel)
@echo