You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

70 lines
1.5 KiB

  1. NETCFG_VERSION := $(shell dpkg-parsechangelog | grep ^Version: |sed 's/Version: //')
  2. DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
  3. DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
  4. CC ?= gcc
  5. TARGETS ?= netcfg-static netcfg
  6. LDOPTS = -ldebconfclient -ldebian-installer
  7. CFLAGS = -W -Wall -Werror -DNDEBUG -DNETCFG_VERSION="\"$(NETCFG_VERSION)\"" -I.
  8. COMMON_OBJS = netcfg-common.o wireless.o write_interface.o ipv6.o
  9. NETCFG_O = netcfg.o dhcp.o static.o ethtool-lite.o wpa.o wpa_ctrl.o rdnssd.o autoconfig.o
  10. NETCFG_STATIC_O = netcfg-static.o static.o ethtool-lite.o
  11. WIRELESS = 1
  12. NM = 1
  13. ifneq ($(DEB_HOST_ARCH_OS),linux)
  14. WIRELESS = 0
  15. NM = 0
  16. endif
  17. ifeq ($(DEB_HOST_ARCH),s390)
  18. WIRELESS = 0
  19. endif
  20. ifeq ($(DEB_HOST_ARCH),s390x)
  21. WIRELESS = 0
  22. endif
  23. ifeq ($(DEB_HOST_ARCH),sparc)
  24. WIRELESS = 0
  25. endif
  26. ifneq ($(WIRELESS),0)
  27. LDOPTS += -liw -lm
  28. CFLAGS += -DWIRELESS
  29. endif
  30. ifneq ($(NM),0)
  31. CFLAGS += -DNM
  32. NETCFG_O += nm-conf.o
  33. endif
  34. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  35. CFLAGS += -O0 -g3
  36. else
  37. CFLAGS += -Os -fomit-frame-pointer
  38. endif
  39. all: $(TARGETS)
  40. netcfg-static: $(NETCFG_STATIC_O)
  41. netcfg: $(NETCFG_O)
  42. ethtool-lite: ethtool-lite-test.o
  43. $(CC) -o $@ $<
  44. ethtool-lite-test.o: ethtool-lite.c
  45. $(CC) -c $(CFLAGS) -DTEST $(DEFS) $(INCS) -o $@ $<
  46. $(TARGETS): $(COMMON_OBJS)
  47. $(CC) -o $@ $^ $(LDOPTS)
  48. %.o: %.c
  49. $(CC) -c $(CFLAGS) $(DEFS) $(INCS) -o $@ $<
  50. clean:
  51. rm -f $(TARGETS) ethtool-lite *.o test/*.o test/run
  52. include test/tests.mk
  53. .PHONY: all clean
  54. # vim:ts=8:noet