-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 957 Bytes
/
Makefile
File metadata and controls
40 lines (29 loc) · 957 Bytes
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
# Required packages: readline-devel glibc-devel gcc gcc-c++ make
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
DETECTED_OS = Windows
else
DETECTED_OS = $(shell uname)
endif
LDFLAGS = -lstdc++ -lm
ifeq ($(DETECTED_OS),Windows)
else
LDFLAGS += -lreadline
endif
CC = gcc
CFLAGS = -g -I. -fno-rtti -fno-exceptions -Wall
CPPFLAGS = $(CFLAGS)
SOURCES = bc.cpp bc_tokenizer.cpp bc_tokenizer.h bc_calc.cpp bc_calc.h arbnum.cpp arbnum.h
all: bc
clean:
rm -f *.o bc
format:
clang-format -style '{BasedOnStyle: Google, DerivePointerBinding: false, Standard: Cpp11}' -i $(SOURCES)
install: all
bc.exe: Makefile bc.o bc_tokenizer.o bc_calc.o arbnum.o
$(CC) $(CFLAGS) -o $@ bc.o bc_tokenizer.o bc_calc.o arbnum.o $(LDFLAGS)
check_win: bc.exe
echo Checks are disabled on Windows
bc: Makefile bc.o bc_tokenizer.o bc_calc.o arbnum.o
$(CC) $(CFLAGS) -o $@ bc.o bc_tokenizer.o bc_calc.o arbnum.o $(LDFLAGS)
check: bc
./bc -t