forked from vdudouyt/minipro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.osx
59 lines (43 loc) · 1.52 KB
/
Makefile.osx
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# minipro Makefile for OS X (tested with OS X Yosemite)
# by Maciej Bartosiak
#
# This Makefile assumes than libusb-1.0.x is installed and visible for compiler
#
VERSION = 0.1
CC = clang
HEADERS = byte_utils.h database.h devices.h easyconfig.h error.h fuses.h main.h minipro.h
COMMON_OBJECTS = byte_utils.o database.o easyconfig.o fuses.o minipro.o
OBJECTS = $(COMMON_OBJECTS) main.o minipro-query-db.o
MINIPRO = minipro
MINIPRO_QUERY_DB= minipro-query-db
PROGS = $(MINIPRO) $(MINIPRO_QUERY_DB)
CFLAGS = -g -O0 -Wall
LIBS = -lusb-1.0 -framework Foundation -framework IOKit
.PHONY: all clean install
all: version $(PROGS)
version:
@echo "#define VERSION \"$(VERSION)\"" > version.h
$(MINIPRO): $(HEADERS) $(COMMON_OBJECTS) main.o
$(CC) -o $(MINIPRO) $(COMMON_OBJECTS) main.o $(LIBS)
$(MINIPRO_QUERY_DB): $(HEADERS) $(COMMON_OBJECTS) minipro-query-db.o
$(CC) -o $(MINIPRO_QUERY_DB) $(COMMON_OBJECTS) minipro-query-db.o $(LIBS)
clean:
rm -f $(OBJECTS) $(PROGS)
INSTALL_DIR = /usr/local
INSTALL_BIN_DIR = $(INSTALL_DIR)/bin
INSTALL_MAN_DIR = $(INSTALL_DIR)/share/man/man1
install: all $(INSTALL_DIR) $(INSTALL_BIN_DIR) $(INSTALL_MAN_DIR)
cp $(MINIPRO) $(INSTALL_BIN_DIR)/
cp $(MINIPRO_QUERY_DB) $(INSTALL_BIN_DIR)/
cp man/minipro.1 $(INSTALL_MAN_DIR)
uninstall:
rm -f $(INSTALL_BIN_DIR)/$(MINIPRO)
rm -f $(INSTALL_BIN_DIR)/$(MINIPRO_QUERY_DB)
rm -f $(INSTALL_MAN_DIR)/minipro.1
$(INSTALL_DIR):
mkdir -p $(INSTALL_DIR)
$(INSTALL_BIN_DIR):
mkdir -p $(INSTALL_BIN_DIR)
$(INSTALL_MAN_DIR):
mkdir -p $(INSTALL_MAN_DIR)