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.
 
 
 
 

53 lines
1.1 KiB

  1. NETCFG_VERSION = $(shell dpkg-parsechangelog | grep ^Version: |sed 's/Version: //')
  2. NETCFG_BUILD_DATE = $(shell date '+%Y%m%d-%H%M')
  3. CC = gcc
  4. TARGETS ?= netcfg-static netcfg
  5. LDOPTS = -ldebconfclient -ldebian-installer
  6. CFLAGS = -W -Wall -DNDEBUG -DNETCFG_VERSION="\"$(NETCFG_VERSION)\"" -DNETCFG_BUILD_DATE="\"$(NETCFG_BUILD_DATE)\""
  7. COMMON_OBJS = netcfg-common.o wireless.o
  8. WIRELESS = 1
  9. ifneq ($(DEB_HOST_ARCH_OS),linux)
  10. WIRELESS = 0
  11. endif
  12. ifeq ($(DEB_HOST_ARCH),s390)
  13. WIRELESS = 0
  14. endif
  15. ifneq ($(WIRELESS),0)
  16. LDOPTS += -liw
  17. CFLAGS += -DWIRELESS
  18. endif
  19. ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  20. CFLAGS += -O0 -g3
  21. else
  22. CFLAGS += -Os -fomit-frame-pointer
  23. endif
  24. all: $(TARGETS)
  25. netcfg-static: netcfg-static.o static.o ethtool-lite.o
  26. netcfg: netcfg.o dhcp.o static.o ethtool-lite.o wpa.o wpa_ctrl.o
  27. ethtool-lite: ethtool-lite-test.o
  28. $(CC) -o $@ $<
  29. ethtool-lite-test.o: ethtool-lite.c
  30. $(CC) -c $(CFLAGS) -DTEST $(DEFS) $(INCS) -o $@ $<
  31. $(TARGETS): $(COMMON_OBJS)
  32. $(CC) -o $@ $^ $(LDOPTS)
  33. %.o: %.c
  34. $(CC) -c $(CFLAGS) $(DEFS) $(INCS) -o $@ $<
  35. clean:
  36. rm -f $(TARGETS) ethtool-lite *.o
  37. .PHONY: all clean
  38. # vim:ts=8:noet