fix -p, so we don't need to supply a pattern
[shallot.git] / Makefile
blob9d6484374c584398ffaaf0860e5a820b30c2f6d4
1 #!/bin/sh
5 ifeq ($(CC),)
6 CC=gcc
7 endif
9 ifeq ($(RM),)
10 RM=rm -f
11 endif
13 ifeq ($(CP),)
14 CP=cp
15 endif
18 CFLAGS:=$(CFLAGS) -O3 -I/usr/include -I/usr/local/include -L/usr/lib -L/usr/local/lib
19 LIBS:=-lm -lpthread -lssl -lcrypto
20 WARNING_FLAGS:=$(WARNING_FLAGS) -Wall
21 DEBUG_FLAGS:=$(DEBUG_FLAGS) -g
24 OBJS:=src/math.o src/error.o src/linux.o src/print.o src/thread.o src/shallot.o
25 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
28 all: $(OBJS)
29 $(CC) $(CFLAGS) -pthread $^ -o shallot $(LIBS)
31 debug: $(OBJS_DBG)
32 $(CC) $(DEBUG_FLAGS) $(CFLAGS) -pthread $^ -o shallot $(LIBS)
34 clean:
35 $(RM) shallot src/*.o
36 install:
37 $(CP) shallot /usr/bin/
38 uninstall:
39 $(RM) /usr/bin/shallot
43 src/%.o: src/%.c
44 $(CC) $(CFLAGS) $(WARNING_FLAGS) -o $@ -c $^
46 src/%.dbg.o: src/%.c
47 $(CC) $(DEBUG_FLAGS) $(CFLAGS) $(WARNING_FLAGS) -o $@ -c $^