-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·36 lines (29 loc) · 937 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
CROSS_COMPILE?=arm-linux-gnueabi-
PASM=/usr/bin/pasm
LIBDIR_APP_LOADER?=/usr/lib
INCDIR_APP_LOADER?=/usr/include
BINDIR=bin
NAME=BeagleBone_PRU_DHT11_DHT22
EXECUTABLE_NAME=dht11
CFLAGS+= -Wall -I$(INCDIR_APP_LOADER) -D__DEBUG -O2 -mtune=cortex-a8 -march=armv7-a
LDFLAGS+=-L$(LIBDIR_APP_LOADER) -lprussdrv -lpthread
OBJDIR=obj
TARGET=$(BINDIR)/$(EXECUTABLE_NAME)
CFILE = $(NAME).c
_DEPS =
DEPS = $(patsubst %,$(INCDIR_APP_LOADER)/%,$(_DEPS))
OBJ = $(OBJDIR)/$(EXECUTABLE_NAME).o
BIN = $(BINDIR)/$(EXECUTABLE_NAME).bin
$(TARGET): $(OBJ) $(BIN)
$(CROSS_COMPILE)gcc $(CFLAGS) -o $(TARGET) $(OBJ) $(LDFLAGS)
$(BIN): $(NAME).p $(NAME).hp
$(PASM) -V3 -b $(NAME).p
mkdir -p $(BINDIR)
mv *.bin $(BINDIR)/$(EXECUTABLE_NAME).bin
scp $(BINDIR)/$(EXECUTABLE_NAME).bin [email protected]:/tmp
$(OBJ): $(NAME).c $(DEPS)
mkdir -p obj
$(CROSS_COMPILE)gcc $(CFLAGS) -c -o $(OBJ) $(CFILE)
.PHONY: clean
clean:
rm -rf $(OBJDIR) $(BINDIR)