build: Pull common fragments into a build.rules file

Some things are used by most of the binaries, pull them
into a common rule fragment that we can use properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2020-09-18 11:49:48 +02:00 committed by Jouni Malinen
parent 21cc50a434
commit a41a29192e
9 changed files with 74 additions and 212 deletions

View file

@ -1,19 +1,6 @@
ALL=eap_example
all: $(ALL)
ifndef CC
CC=gcc
endif
ifndef RANLIB
RANLIB=ranlib
endif
ifndef CFLAGS
CFLAGS = -MMD -O2 -Wall -g
endif
include ../src/build.rules
CFLAGS += -I.
CFLAGS += -I../src
@ -95,22 +82,6 @@ OBJS_server += ../src/eap_server/eap_server_tls_common.o
CFLAGS += -DEAP_SERVER
ifndef LDO
LDO=$(CC)
endif
Q=@
E=echo
ifeq ($(V), 1)
Q=
E=true
endif
%.o: %.c
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
@$(E) " CC " $<
OBJS_lib=$(OBJS_both) $(OBJS_peer) $(OBJS_server)
OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o