Skip to content

Commit

Permalink
Remove all sub-makefiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Nov 21, 2024
1 parent efb4ded commit 75505d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 80 deletions.
14 changes: 7 additions & 7 deletions C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ C_OBJ=$(patsubst ./src/%.c, ./build/%.o, $(C_SRC))

SLIB=$(BUILD_DIR)/$(LIBNAME).a

.PHONY: headers sources clean
.PHONY: clean example

all: build static shared

Expand All @@ -19,6 +19,7 @@ all: build static shared
headers: $(C_HEADERS)

sources: headers $(C_SRC)
mkdir -p ./build

./src/%.c: ../data/%.toml
$(PY) $(GEN_C) $< $@
Expand All @@ -33,21 +34,20 @@ src/%.c: ../data/%.toml

# ---------------------------------------------------------------------
# COMPILATION
build: $(C_OBJ)
mkdir -p $(BUILD_DIR)
build: sources $(C_OBJ) ./build/codata_version.o

example: sources headers build
make -C example
example: ./example/example.c build static shared
gcc $< -I./include -L./build/ -lcodata $(CFLAGS_RELEASE) $(FPM_CFLAGS) -o ./build/$@ -Wl,-rpath=.

build/%.o: src/%.c
gcc -c -I./include $(CFLAGS_RELEASE) $(FPM_CFLAGS) $< -o $@
gcc -c -I./include -fPIC $(CFLAGS_RELEASE) $(FPM_CFLAGS) $< -o $@
# ---------------------------------------------------------------------


# ---------------------------------------------------------------------
# LINKING - STATIC and DYNAMIC LIBS
static: build
ar -crs $(SLIB) $(C_OBJ)
ar -crs $(SLIB) $(C_OBJ) ./build/codata_version.o

shared: build static shared_$(PLATFORM)

Expand Down
6 changes: 0 additions & 6 deletions C/example/Makefile

This file was deleted.

34 changes: 0 additions & 34 deletions C/include/Makefile

This file was deleted.

33 changes: 0 additions & 33 deletions C/src/Makefile

This file was deleted.

0 comments on commit 75505d0

Please sign in to comment.