[PATCH 1/6] build: pull common fragments into a common.rules file

Jouni Malinen j at w1.fi
Sun Jun 21 06:04:03 EDT 2020


On Fri, Jun 19, 2020 at 11:47:46AM +0200, Johannes Berg wrote:
>  src/common.rules        | 42 ++++++++++++++++++++++++++

That name is not exactly convenient for someone who is working with
src/common/* files and tab completion.. Maybe src/build.rules?

> diff --git a/hs20/client/Makefile b/hs20/client/Makefile
> @@ -97,12 +75,8 @@ hs20-osu-client: $(OBJS)
>  	$(Q)$(LDO) $(LDFLAGS) -o hs20-osu-client $(OBJS) $(LIBS)
>  	@$(E) "  LD " $@
>  
> -%.o: %.c
> -	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
> -	@$(E) "  CC " $<
> -
> -clean:
> -	rm -f core *~ *.o *.d hs20-osu-client
> +clean: common-clean
> +	rm -f core *~ *.o *.d
>  	rm -f ../../src/utils/*.o

What is this common-clean? It does not seem to be defined anywhere:

hostap/hs20/client$ make clean
Makefile:89: warning: overriding recipe for target 'clean'
Makefile:79: warning: ignoring old recipe for target 'clean'
make: *** No rule to make target 'common-clean', needed by 'clean'.  Stop.

> @@ -111,5 +85,5 @@ clean:
>  	rm -f ../../src/crypto/*.d
>  	rm -f ../../src/wps/*.o
>  	rm -f ../../src/wps/*.d
> -
> --include $(OBJS:%.o=%.d)

Why would that use of *.d be removed?

> +clean: common-clean
> +	rm -f core *~

And this is that overriding recipe part..

> diff --git a/hs20/server/Makefile b/hs20/server/Makefile
> @@ -43,11 +33,12 @@ CFLAGS += $(shell xml2-config --cflags)
>  LIBS += $(shell xml2-config --libs)
>  OBJS += ../../src/utils/xml_libxml2.o
>  
> +$(call BUILDOBJS,OBJS)
>  hs20_spp_server: $(OBJS)

What does that call do?

>  	$(LDO) $(LDFLAGS) -o hs20_spp_server $(OBJS) $(LIBS)
>  
> -clean:
> -	rm -f core *~ *.o *.d hs20_spp_server
> +clean: common-clean
> +	rm -f core *~ *.o *.d
>  	rm -f ../../src/utils/*.o

And here's that same issue with undefined common-clean.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list