-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (31 loc) · 943 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
38
39
40
41
42
43
44
45
46
include Kbuild.include
BIN := messybox
SCRIPTS := ldd2
CROSS_COMPILE ?= # override as needed
INSTALL = /usr/bin/install
DESTDIR =
PREFIX = $(HOME)
BINDIR = $(PREFIX)/bin
#INCLUDE := -include config.h
KBUILD_CFLAGS := -Wall -O2 -DBIN_NAME='"$(BIN)"'
obj-y += main.o
obj-y += mem.o
obj-y += i2c.o
obj-y += gettimeofday.o
all: $(BIN)
quiet_cmd_link = LINK $@
cmd_link = $(LD) -o $@ $(filter $(obj-y), $^)
$(BIN): $(obj-y) FORCE
$(call if_changed,link)
clean-files := $(BIN)
quiet_cmd_install = INSTALL $@
cmd_install = $(INSTALL) -D $(notdir $@) $@
SYMLINKS := $(addprefix $(DESTDIR)$(BINDIR)/, md mm mw i2c gettimeofday)
install: $(addprefix $(DESTDIR)$(BINDIR)/, $(BIN) $(SCRIPTS)) $(SYMLINKS)
$(addprefix $(DESTDIR)$(BINDIR)/, $(BIN) $(SCRIPTS)): FORCE
$(call cmd,install)
quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -f -s $(BIN) $@
$(SYMLINKS): FORCE
$(call cmd,symlink)
include Makefile.build