blob: b8ab2b60de9007eb44bbf8c68ace1e022fb76a39 (
plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
##############
# Fool Stack #
##############
############ compiler ############
#use our cross compiler
CC=i686-foolos-gcc
AS=i686-foolos-as
#sorry just this
CC=i686-elf-gcc
AS=i686-elf-as
############ compiler flags ############
#https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
CFLAGS=
#CFLAGS+=-fvar-tracking
#CFLAGS+=-DGIT_REVISION=\"$(GIT_REVISION)\"
CFLAGS+=-ffreestanding # do we need this if using own compiler?
CFLAGS+=-nostdlib
#CFLAGS+=-Og
CFLAGS+=-O0
#CFLAGS+=-I.
#CFLAGS+=-I/home/miguel/temp/foolos/usr/i686-foolos/include/
#CFLAGS+=-I./asm
#CFLAGS+=-I./kernel
#CFLAGS+=-I./driver
#CFLAGS+=-I./fs
CFLAGS+=-gstabs
#CFLAGS+=-fstack-protector-all
#CFLAGS+=-fno-zero-initialized-in-bss
#CFLAGS+=-fdata-sections -ffunction-sections
#CFLAGS+= -w # disable all warnings
#CFLAGS+= -Wimplicit-function-declaration
CFLAGS+= -Wall
#CFLAGS+= -Wextra
#CFLAGS+= -pedantic
CFLAGS+= -Werror
CFLAGS+= -Werror=implicit-function-declaration
CFLAGS+= -Wno-unused-variable
CFLAGS+= -Wno-unused-function
CFLAGS+= -Wno-int-conversion
CFLAGS+= -Wno-implicit-int
CFLAGS+= -Wno-incompatible-pointer-types
CFLAGS+= -Wno-discarded-qualifiers
CFLAGS+= -Wno-unused-but-set-variable
#CFLAGS+ = -Wall -Wextra -std=c89 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition
######## linker flags ####################
LDFLAGS=
LDLIBS+=-lgcc
########## assembler flags #################
ASFLAGS=
ASFLAGS+=-gstabs
########## verbosity ##################3
#V = 0
#CC = @echo "Compiling (i686-elf-gcc) $<..."; i686-elf-gcc
#AS = @echo "Assembling (i686-elf-as) $<..."; i686-elf-as
#CC_1 = $(CCC)
#CC = $(CC_$(V))
############ source and object files and their deps ############
#source files
SOURCES=
SOURCES+=$(wildcard *.c)
#derive object files
OBJECTS=$(patsubst %.c, %.o, $(SOURCES))
#derive and include deps
DEPS=$(patsubst %.c, %.d, $(SOURCES))
-include $(DEPS)
tags:
@echo "Generating ctags..."; ctags --recurse=yes .
clean:
@echo "Cleaning..."; rm -f *.d *.o tags
|