-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
91 lines (71 loc) · 1.95 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#***************************************************************************
#
# Copyright (c) 1997-2019 Jeffrey Vernon Merkey
# All Rights Reserved.
#
#**************************************************************************
INCLUDES=cworthy.h netware-screensaver.h
UTILFILES=libcworthy.so libcworthy.a ifcon cw
# user utility build flags
U_CC = gcc
U_CCP = g++
U_CFLAGSP = -g -O3
U_CFLAGS_LIBP = -g -c -O3
LD = ld
AR = ar
LDCONFIG = ldconfig
LIBS = /usr/lib
INCS = /usr/include
BIN = /usr/bin
ARCH := $(shell uname -m)
ifeq ($(ARCH), x86_64)
LIBS = /usr/lib64
endif
ifeq ($(ARCH), aarch64)
LIBS = /usr/lib64
endif
ifeq ($(ARCH), i686)
LIBS = /usr/lib
endif
ifdef LIBDIR
LIBS = $(LIBDIR)
endif
ifdef INCDIR
INCS = $(INCDIR)
endif
ifdef BINDIR
BIN = $(BINDIR)
endif
ifeq ($(NOCHK),1)
LDCONFIG =
endif
all : utilities
libcworthy.so: cworthy.o netware-screensaver.o
$(LD) -shared -lc -o libcworthy.so cworthy.o netware-screensaver.o
libcworthy.a: cworthy.o netware-screensaver.o
$(AR) r libcworthy.a cworthy.o netware-screensaver.o
cworthy.o: cworthy.c $(INCLUDES)
$(U_CCP) $(U_CFLAGS_LIBP) -fPIC -Wall cworthy.c
netware-screensaver.o: netware-screensaver.c $(INCLUDES)
$(U_CCP) $(U_CFLAGS_LIBP) -fPIC -Wall netware-screensaver.c
ifcon: ifcon.c libcworthy.so libcworthy.a $(INCLUDES)
$(U_CCP) $(U_CFLAGSP) ifcon.c libcworthy.a -Wall -o ifcon -lncursesw -lpthread -ltinfo
cw: cw.c libcworthy.so libcworthy.a $(INCLUDES)
$(U_CCP) $(U_CFLAGSP) cw.c libcworthy.a -Wall -o cw -lncursesw -lpthread -ltinfo
clean:
rm -rf *.o $(UTILFILES)
utilities: $(UTILFILES)
install: utilities
install -m 0755 ifcon $(DESTDIR)$(BIN)
install -m 0755 libcworthy.so $(DESTDIR)$(LIBS)
install -m 644 libcworthy.a $(DESTDIR)$(LIBS)
install -m 644 cworthy.h $(DESTDIR)$(INCS)
$(LDCONFIG)
$(LDCONFIG)
uninstall:
rm -vf $(DESTDIR)$(BIN)/ifcon
rm -vf $(DESTDIR)$(LIBS)/libcworthy.so
rm -vf $(DESTDIR)$(LIBS)/libcworthy.a
rm -vf $(DESTDIR)$(INCS)/cworthy.h
$(LDCONFIG)
$(LDCONFIG)