I have changed the makefile. What do you think of it?
CC = gcc
BIN = lib/libnmea.a MODULES = generate generator parse parser tok context time info math sentence
OBJ = $(MODULES:%=build/%.o) LINKOBJ = $(OBJ) $(RES) INCS = -I"include"
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom rm -f $(LINKOBJ) $(BIN)
$(BIN): $(LINKOBJ) $(CC) -G $^ -o $@
build/%.o: src/%.c $(CC) $(INCS) -c $< -o $@
I`ll check it and add to the next release.
It would be nice if the Makefile also builds .so libraries (with -fPIC).
Log in to post a comment.
I have changed the makefile.
What do you think of it?
CC = gcc
BIN = lib/libnmea.a
MODULES = generate generator parse parser tok context time info math sentence
OBJ = $(MODULES:%=build/%.o)
LINKOBJ = $(OBJ) $(RES)
INCS = -I"include"
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
rm -f $(LINKOBJ) $(BIN)
$(BIN): $(LINKOBJ)
$(CC) -G $^ -o $@
build/%.o: src/%.c
$(CC) $(INCS) -c $< -o $@
I`ll check it and add to the next release.
It would be nice if the Makefile also builds .so libraries (with -fPIC).