1 files changed, 15 insertions(+), 5 deletions(-)
M Makefile
M Makefile => Makefile +15 -5
@@ 1,14 1,24 @@
CFLAGS = -Wall -Wextra -pedantic -std=c99
LIBS = -lcrypto
+ifdef OPENSSLDIR
+ IDIR = -I$(OPENSSLDIR)/include
+ LDIR = -L$(OPENSSLDIR)/lib
+endif
+
+ifneq ($(strip $(DEBUG)),)
+ CFLAGS += -g -O0
+endif
+
+.PHONY: all clean
+
+all: madness
+
madness: madness.o
- $(CC) $^ -o $@ $(LIBS)
+ $(CC) $(LIBS) $(LDIR) -o $@ $^
madness.o: madness.c
- $(CC) $(CFLAGS) -c $^ -o $@
-
-debug: madness.c
- $(CC) $(CFLAGS) -g $^ -o madness $(LIBS)
+ $(CC) $(CFLAGS) $(IDIR) -c -o $@ $^
clean:
$(RM) *.o madness