clean up makefile

This commit is contained in:
jacekpoz 2024-02-10 14:09:43 +01:00
parent d6b05cd7b7
commit 92a9fb163f
No known key found for this signature in database
GPG key ID: 94E812A8B12AAE3C

View file

@ -24,18 +24,18 @@ modules: dirs $(MOD:.c=.so)
dirs:
mkdir -p ./$(BIN)
run: all
$(BIN)/$(PROGRAM)
$(PROGRAM): $(OBJ)
$(PROGRAM): $(addprefix $(BIN)/, $(OBJ))
$(CC) -o $(BIN)/$(PROGRAM) $^ $(LDFLAGS)
$(BIN)/%.o: %.c
$(CC) -o $@ -c $< $(CFLAGS)
%.o: %.c
$(CC) -o $(BIN)/$@ -c $< $(CFLAGS)
%.so: modules/%.c
$(CC) -o $(BIN)/$@ $^ -shared -fPIC $(CFLAGS)
clean:
clean: clean_modules
rm -rf $(OBJ)
rm -rf $(PROGRAM)
clean_modules:
rm -rf $(wildcard $(BIN)/*.so)