-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (23 loc) · 677 Bytes
/
Makefile
File metadata and controls
27 lines (23 loc) · 677 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
FILE=queue
SRC_FILE=src/$(FILE)
LIB_FILE=lib/lib$(FILE)
LIBS_DIR=libs
INCLUDES_DIR=libs/include
dependencies:
mkdir -p $(LIBS_DIR)
mkdir -p $(INCLUDES_DIR)
wget -O $(INCLUDES_DIR)/assert.h https://raw.githubusercontent.com/ss-c-cpp/assert/master/lib/assert.h
wget -O $(LIBS_DIR)/libassert.a https://raw.githubusercontent.com/ss-c-cpp/assert/master/lib/libassert.a
lib: src/$(FILE).o
mkdir -p lib
gcc -c -o $(SRC_FILE).o $(SRC_FILE).c
ar -cvq $(LIB_FILE).a $(SRC_FILE).o
cp $(SRC_FILE).h lib/$(FILE).h
test:
mkdir -p out
gcc -g -static \
-o out/queue-test.out \
test/queue-test.c $(SRC_FILE).c \
-L$(LIBS_DIR) -lassert
./out/queue-test.out
.PHONY: test lib