-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathMakefile.apop
52 lines (39 loc) · 1.24 KB
/
Makefile.apop
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
# Makefile.apop -*- mode: makefile -*-
# run from build directory: make -f ../src.git/Makefile.apop [TARGET] [macros]
# using 21st Century C's guidelines
OBJS+=glibSpecializations.o
OBJS+=imputeMissingCodes.o
PGMS+=imputeMissingCodes
PGMS+=test-no-main-reference
# handle command line macro definitions name=value
# COMPILER=[clang|gcc]
# OPTIMIZATION=[|-O1|-O2|-O3]
ifndef COMPILER
COMPILER=clang
#CC=clang
endif
ifndef OPTIMIZATION
OPTIMIZATION=
endif
# `pkg-config --cflags apohenia` is empty
# `pkg-config --libs apophenia ` includes gsl
PKGS=apophenia glib-2.0
INCLUDES=-Iusr/include/apophenia `pkg-config --cflags $(PKGS)`
CFLAGS=-c -Wall -Werror -std=gnu99 -g $(OPTIMIZATION) $(INCLUDES)
LDLIBS=`pkg-config --libs $(PKGS)` -lm -lc
# run from build directory, so say where the source files are
SRC= ../src.git
vpath %.c $(SRC)
vpath %.h $(SRC)
# allow command line to override CC, the c compiler to use
# set default value for CC
%.o : %.c
# COMPILER=$(COMPILER)
# OPTIMIZATION=$(OPTIMIZATION)
$(COMPILER) $(CFLAGS) $< -o $@
all: $(PGMS)
imputeMissingCodes: imputeMissingCodes.o Log.o glibSpecializations.o
#$(COMPILER) $^ $(LDLIBS) -o $@
$(COMPILER) $^ $(LDLIBS) -o $@
testNoMainReference: testNoMainReference.o
$(COMPILER) $^ $(LDLIBS) -o $@