-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 755 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 755 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
40
41
42
43
44
#
# quicksort test
#
# setup
NAME = quicktest
ASM_SRC = quick.asm
C_OBJS = quickc.o
ASM_OBJS = quick.o
OBJS = $(C_OBJS) $(ASM_OBJS)
# flags
DEBUG = -ggdb
OPTIMISE = -O0
WARNINGS = -Wall -ansi -pedantic# -Wextra
TARGET_C = -m32
TARGET_ASM = -f elf32
CFLAGS = $(DEBUG) $(OPTIMISE) $(WARNINGS) $(TARGET_C)
# commands
ASM = nasm
CC = gcc
RM = rm -f
ASSEMBLE = $(ASM) $(TARGET_ASM)
COMPILE = $(CC) $(CFLAGS) $(DFLAGS)
# rules #######################################################################
all: clean $(NAME)
$(NAME): $(OBJS)
$(COMPILE) -o $@ $(OBJS)
$(ASM_OBJS): $(ASM_SRC)
$(ASSEMBLE) $(ASM_SRC)
#%.o: %.c %.h
# $(CC) -c $< $(TARGET_C)
#.PHONY: clean
clean:
$(RM) $(NAME)
$(RM) *.o