-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
37 lines (28 loc) · 904 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Hey Emacs, this is a -*- makefile -*-
ifndef CONFIG
CONFIG = config
endif
CONFDATA := $(shell perl scripts/configparser.pl --confdata $(CONFIG))
CONFIGSUFFIX := $(word 1,$(CONFDATA))
OBJDIR := obj-$(CONFIGSUFFIX)
CONFFILES := $(wordlist 2,99,$(CONFDATA))
export CONFIGSUFFIX CONFIG OBJDIR
# Enable verbose compilation with "make V=1"
ifdef V
Q :=
E := @:
else
Q := @
E := @echo
endif
all: $(OBJDIR) $(OBJDIR)/make.inc
$(Q)$(MAKE) --no-print-directory -f scripts/Makefile.main
$(OBJDIR)/make.inc: $(CONFFILES) | $(OBJDIR)
$(E) " CONFIG $(CONFFILES)"
$(Q)perl scripts/configparser.pl --genfiles --makeinc $(OBJDIR)/make.inc --header $(OBJDIR)/autoconf.h $(CONFIG)
$(OBJDIR):
$(E) " MKDIR $(OBJDIR)"
-$(Q)mkdir $(OBJDIR)
copy clean fuses program delete-eeprom: FORCE | $(OBJDIR) $(OBJDIR)/make.inc
$(Q)$(MAKE) --no-print-directory -f scripts/Makefile.main $@
FORCE: ;