-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (32 loc) · 943 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
37
38
39
40
41
42
43
44
# -*- mode: makefile -*-
PREFIX ?= /usr/local
SRC = .
CFLAGS = -Wall -Werror -std=c99 -pedantic -ggdb
LFLAGS =
LDFLAGS =
# Uncomment the following if target is a Shared library
CFLAGS += -fPIC -I/usr/include/bash -I/usr/include/bash/include
LFLAGS += --shared
# Build module list (info make -> "Functions" -> "File Name Functions")
MODULES = $(addsuffix .o,$(basename $(wildcard $(SRC)/*.c)))
ROOTS = $(filter-out ./utilities, $(basename $(wildcard $(SRC)/*.c)))
BUILTINS = $(addsuffix .so, $(ROOTS))
# Libraries need header files. Set the following accordingly:
HEADERS =
# Declare non-filename targets
.PHONY: all install uninstall clean help
all: $(BUILTINS)
%so : %o
$(CC) $(LFLAGS) -o $@ $< $(LDFLAGS)
%o : %c
$(CC) $(CFLAGS) -c -o $@ $<
test:
@echo $(BUILTINS)
clean:
rm -f *.so
rm -f $(MODULES)
help:
@echo "Makefile options:"
@echo
@echo " clean to remove generated files"
@echo " help this display"