forked from katmagic/Shallot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (30 loc) · 883 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
#!/bin/sh
ifeq ($(CC),)
CC=gcc
endif
ifeq ($(RM),)
RM=rm -f
endif
ifeq ($(CP),)
CP=cp
endif
CFLAGS:=$(CFLAGS) -O3 -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib
LIBS:=-lm -lpthread -lssl -lcrypto
WARNING_FLAGS:=$(WARNING_FLAGS) -Wall
DEBUG_FLAGS:=$(DEBUG_FLAGS) -g
OBJS:=src/math.o src/error.o src/linux.o src/print.o src/thread.o src/shallot.o
OBJS_DBG:=src/math.dbg.o src/error.dbg.o src/linux.dbg.o src/print.dbg.o src/thread.dbg.o src/shallot.dbg.o
all: $(OBJS)
$(CC) $(CFLAGS) -pthread $^ -o shallot $(LIBS)
debug: $(OBJS_DBG)
$(CC) $(DEBUG_FLAGS) $(CFLAGS) -pthread $^ -o shallot $(LIBS)
clean:
$(RM) shallot src/*.o
install:
$(CP) shallot /usr/bin/
uninstall:
$(RM) /usr/bin/shallot
src/%.o: src/%.c
$(CC) $(CFLAGS) $(WARNING_FLAGS) -o $@ -c $^
src/%.dbg.o: src/%.c
$(CC) $(DEBUG_FLAGS) $(CFLAGS) $(WARNING_FLAGS) -o $@ -c $^