-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (29 loc) · 1.1 KB
/
Makefile
File metadata and controls
37 lines (29 loc) · 1.1 KB
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
INCLUDES=-Iinclude/
CFLAGS=$(INCLUDES) -m64 -Wall -Werror -pedantic -masm=intel
OBJC=objs/dummy.c.o objs/bigint_mm.c.o objs/bigint_sa.c.o objs/bigint_cmp.c.o
OBJC+=objs/bigint_sd.c.o objs/bigint_bo.c.o
OBJS=
OUTPUT=libsammy.a
.PHONY: debug
default: $(OUTPUT)
debug: CFLAGS += -g -O0 -D__DEBUG
debug: $(OUTPUT)
################################################################################
# SOURCES STUFF #
################################################################################
objs/%.o: src/%
@mkdir -p objs/
$(CC) -c -o $@ $< $(CFLAGS)
$(OUTPUT): $(OBJS) $(OBJC)
ar rcs $(OUTPUT) $(OBJS) $(OBJC)
.PHONY: clean
clean:
-rm -f $(OBJS) $(OBJC)
-rm -f $(OUTPUT)
-rm -f demo/demo
################################################################################
# COMMAND LINE STUFF #
################################################################################
demo: CFLAGS += -g -O0 -D__DEBUG
demo: $(OUTPUT) demo/demo.c
$(CC) demo/demo.c -L. -lsammy -o demo/demo $(CFLAGS)