-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.37 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
# This file belongs to the Open Source Community Africa, permissions are
# hereby granted to distribute, modify or even commercialized so long as
# this ownership notice is kept and the commercialized version retains an
# explicit license from OSCA. And therefore abiding all Community Licence
#
# NOTE: We therefore own it that we are the makers and architects of the
# Opensource Community Licence (OCL). visit http://oscakampala.org/licence
# for more and https://oscakampala.org/contribution for the ever best
# contribution practices.
#
# The future is Open!
# Author: Phrunsys Emmason
# Email: [email protected]
# Bug reports: https://bugmania.oscakampala.org/
# Compiler and flags
SPL := scpel
CFLAGS := -Wall -Iinc
# Source and object files
SRC_DIR := source
INC_DIR := includes
OBJ_DIR := forge
EXA_DIR := examples
TST_DIR := testsuite
# List of source files
SRC_FILES := $(wildcard $(SRC_DIR)/*.scpel)
# Generate a list of object files from source files
OBJ_FILES := $(patsubst $(SRC_DIR)/%.scpel, $(OBJ_DIR)/%.o, $(SRC_FILES))
# Target for the static library
LIB_NAME := libsdv.a
LIB_TARGET := $(LIB_NAME)
# Targets
all: $(LIB_TARGET)
$(LIB_TARGET): $(OBJ_FILES)
ar rcs $(LIB_NAME) $(OBJ_FILES)
# Rule to compile source files into object files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.scpel
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(OBJ_DIR) $(LIB_NAME)
.PHONY: all clean