-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (42 loc) · 1.42 KB
/
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
47
48
49
50
PNAME = geoconformimage
PROGNAME = $(PNAME)
CC = gcc
CPP = g++
CFLAGS = -Isrc -DUNIX -O2 -Wall -s
SRCS = src
VER = 0
VERB = 20210502
ifeq ($(OS),Windows_NT)
LIBS = $(SRCS)/FreeImage.lib
PLIBF = $(PNAME).$(VER).dll
PLIBFI = $(PNAME)freeimage.$(VER).dll
else
LIBS = -lfreeimage
PLIBF = lib$(PNAME).so.$(VER)
PLIBFI = lib$(PNAME)freeimage.so.$(VER)
endif
PLIB = $(PLIBF) $(PLIBFI)
PREFIX = /usr/local
DOCPREFIX = $(PREFIX)/share/doc/$(PNAME)
INSTALL = install
LN = ln -fs
RM = rm -f
.PHONY: all clean install
all: $(PROGNAME)
clean:
$(RM) $(PROGNAME) $(PLIBF) $(PLIBFI) *.exe $(SRCS)/*.o
$(SRCS)/geoconform.o: $(SRCS)/geoconform.c
$(CC) $(CFLAGS) -c $^ -o $@
$(SRCS)/geoconformfreeimage.o: $(SRCS)/geoconformfreeimage.cpp
$(CPP) $(CFLAGS) -c $^ -o $@
$(SRCS)/geoconformimage.o: $(SRCS)/geoconformimage.cpp
$(CPP) $(CFLAGS) -c $^ -o $@
$(PROGNAME): $(SRCS)/geoconform.o $(SRCS)/geoconformfreeimage.o $(SRCS)/geoconformimage.o
$(CPP) $(CFLAGS) $^ -o $@ $(LIBS)
install: $(PROGNAME)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) -m 0755 $(PROGNAME) $(PREFIX)/bin/
$(INSTALL) -d $(PREFIX)/share/man/man1
$(INSTALL) -m 0644 man/man1/*.1 $(PREFIX)/share/man/man1
$(INSTALL) -d $(PREFIX)/share/doc/$(PNAME)
$(INSTALL) -m 0644 CHANGELOG LICENSE README.md VERSION $(PREFIX)/share/doc/$(PNAME)