Makefile 1.1 KB
Newer Older
Valentin Dudouyt's avatar
Valentin Dudouyt committed
1
.PHONY: all clean install test
2
COMMON_OBJECTS=byte_utils.o database.o minipro.o fuses.o easyconfig.o
3 4 5 6
OBJECTS=$(COMMON_OBJECTS) main.o minipro-query-db.o
PROGS=minipro minipro-query-db
MINIPRO=minipro
MINIPRO_QUERY_DB=minipro-query-db
7 8 9
TESTS=$(wildcard tests/test_*.c);
OBJCOPY=objcopy

Valentin Dudouyt's avatar
Valentin Dudouyt committed
10 11 12
BIN_DIR=$(DESTDIR)/usr/bin/
UDEV_RULES_DIR=$(DESTDIR)/etc/udev/rules.d/
MAN_DIR=$(DESTDIR)/usr/share/man/man1/
13
COMPLETIONS_DIR=$(DESTDIR)/etc/bash_completion.d/
Valentin Dudouyt's avatar
Valentin Dudouyt committed
14

Valentin Dudouyt's avatar
Valentin Dudouyt committed
15
override CFLAGS += `pkg-config --cflags libusb-1.0` -g -O0
16 17
LIBS = `pkg-config --libs libusb-1.0`

18 19 20
all: $(OBJECTS) $(PROGS)

minipro: $(COMMON_OBJECTS) main.o
21
	$(CC) $(COMMON_OBJECTS) main.o $(LIBS) -o $(MINIPRO)
22 23

minipro-query-db: $(COMMON_OBJECTS) minipro-query-db.o
24
	$(CC) $(COMMON_OBJECTS) minipro-query-db.o $(LIBS) -o $(MINIPRO_QUERY_DB)
25 26

clean:
27
	rm -f $(OBJECTS) $(PROGS)
28

Valentin Dudouyt's avatar
Valentin Dudouyt committed
29 30 31 32
install:
	mkdir -p $(BIN_DIR)
	mkdir -p $(UDEV_RULES_DIR)
	mkdir -p $(MAN_DIR)
33
	mkdir -p $(COMPLETIONS_DIR)
Valentin Dudouyt's avatar
Valentin Dudouyt committed
34 35 36
	cp $(MINIPRO) $(BIN_DIR)
	cp $(MINIPRO_QUERY_DB) $(BIN_DIR)
	cp udev/rules.d/80-minipro.rules $(UDEV_RULES_DIR)
37
	cp bash_completion.d/minipro $(COMPLETIONS_DIR)
Valentin Dudouyt's avatar
Valentin Dudouyt committed
38
	cp man/minipro.1 $(MAN_DIR)