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: dirs:
mkdir -p ./$(BIN) mkdir -p ./$(BIN)
run: all $(PROGRAM): $(addprefix $(BIN)/, $(OBJ))
$(BIN)/$(PROGRAM)
$(PROGRAM): $(OBJ)
$(CC) -o $(BIN)/$(PROGRAM) $^ $(LDFLAGS) $(CC) -o $(BIN)/$(PROGRAM) $^ $(LDFLAGS)
$(BIN)/%.o: %.c %.o: %.c
$(CC) -o $@ -c $< $(CFLAGS) $(CC) -o $(BIN)/$@ -c $< $(CFLAGS)
%.so: modules/%.c %.so: modules/%.c
$(CC) -o $(BIN)/$@ $^ -shared -fPIC $(CFLAGS) $(CC) -o $(BIN)/$@ $^ -shared -fPIC $(CFLAGS)
clean: clean: clean_modules
rm -rf $(OBJ) rm -rf $(OBJ)
rm -rf $(PROGRAM) rm -rf $(PROGRAM)
clean_modules:
rm -rf $(wildcard $(BIN)/*.so)