This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
36 lines (24 loc) · 1.55 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
CC = gcc
RM = rm -Rf
CFLAGS = -m64 -ggdb -x c -std=gnu99 -c -Wall -Wextra -Werror -pedantic-errors -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs -Wparentheses -Wswitch-default -Wswitch-enum -Wsync-nand -Wuninitialized -Wunknown-pragmas -Wstrict-overflow=2 -Wfloat-equal -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wpacked -Wpacked-bitfield-compat -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs -Wparentheses -Wswitch-default -Wswitch-enum -Wsync-nand -Wuninitialized -Wunknown-pragmas -Wstrict-overflow=2 -Wfloat-equal -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wpacked -Wpacked-bitfield-compat -Wredundant-decls -Wnested-externs -Winline -Woverlength-strings -Wcomments -Wundef -Wunused-macros -Wendif-labels
LDFLAGS =
SRCROOT = src/c/src
INCROOT = src/c/include
TSTROOT = test/c
OBJROOT = build
BINROOT = bin
VPATH=$(SRCROOT):$(INCROOT):$(TSTROOT):$(OBJROOT)
.PHONY: all clean test_clean
all: runtime.o stst.o stst
runtime.o: runtime.c runtime.h
$(CC) $(CFLAGS) -I$(INCROOT) -o $(OBJROOT)/$(@) $(<)
stst.o: stst.s
$(CC) -m64 -c -o $(OBJROOT)/$(@) $(<)
stst: runtime.o stst.o
$(CC) -o $(BINROOT)/$(@) $(OBJROOT)/runtime.o $(OBJROOT)/stst.o
clean test_clean:
$(RM) $(OBJROOT)/*.s
$(RM) $(OBJROOT)/*.o
$(RM) $(BINROOT)/*
$(RM) stst.out
.SILENT: stst.o stst test_clean