-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 933 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CC = gcc
CFLAGS = -g -ggdb -Wextra -Wall -pedantic -Wwrite-strings -std=gnu99 -pedantic -march=native -masm=intel -pipe
OPTIM = -O2
PROGNAME = upek
OBJECTS = upek.o
INCFLAGS =
LDFLAGS = -lbsapi
LIBS =
ASM = as
ASMFLAGS = --warn -march=core2 --gstabs+
COMPILE_TO_ASM_FLAGS = -fverbose-asm -S
CFLAGS_ADDITIONAL =
LDFLAGS_ADDITIONAL =
all: $(PROGNAME)
safe: O0
O0:
@make all OPTIM=-O0 -B
O1:
@make all OPTIM=-O1 -B
O2:
@make all OPTIM=-O2 -B
O3:
@make all OPTIM=-O3 -B
$(PROGNAME): $(OBJECTS)
@echo " LD $(PROGNAME) "
@$(CC) -o $(PROGNAME) $(OBJECTS) $(LDFLAGS) $(LDFLAGS_ADDITIONAL) $(LIBS)
profile:
@make -B all CFLAGS_ADDITIONAL=-pg LDFLAGS_ADDITIONAL=-pg
.SUFFIXES: .c .cc .C .cpp .o .s
.c.o :
@echo " CC $@"
@$(CC) -o $@ -c $(CFLAGS) $(CFLAGS_ADDITIONAL) $(OPTIM) $< $(INCFLAGS)
.s.o:
@echo " AS $@"
@$(ASM) -o $@ $(ASMFLAGS) $<
clean:
@rm -f *.o $(PROGNAME)
.PHONY: all
.PHONY: clean