Skip to content

Commit

Permalink
Use internal flags in Makefile
Browse files Browse the repository at this point in the history
So one can safely override CFLAGS, CPPFLAGS and LDFLAGS

E.g. make CFLAGS=-Os OPENSSL=1
  • Loading branch information
wiire-a committed Dec 27, 2017
1 parent a2f1182 commit 5670f8c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
@@ -1,4 +1,4 @@
CFLAGS = -std=c99 -O3
CFLAGS = -O3

PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
Expand All @@ -8,10 +8,13 @@ SRCDIR = src
HDRS = $(SRCDIR)/config.h $(SRCDIR)/endianness.h $(SRCDIR)/version.h
HDRS += $(SRCDIR)/pixiewps.h $(SRCDIR)/utils.h $(SRCDIR)/wps.h

# Internal flags so one can safely override CFLAGS, CPPFLAGS and LDFLAGS
INTFLAGS = -std=c99
LIBS = -lpthread

ifeq ($(OPENSSL),1)
LIBS += -lcrypto
CFLAGS += -DUSE_OPENSSL
INTFLAGS += -DUSE_OPENSSL
endif

TARGET = pixiewps
Expand All @@ -24,7 +27,7 @@ SOURCE = $(SRCDIR)/pixiewps.c
all: $(TARGET)

$(TARGET): $(SOURCE) $(HDRS)
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) $(SOURCE) $(LIBS) $(LDFLAGS)
$(CC) $(INTFLAGS) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) $(SOURCE) $(LIBS) $(LDFLAGS)

install: install-bin install-man

Expand Down

0 comments on commit 5670f8c

Please sign in to comment.