1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-30 07:03:26 +01:00

Merge pull request #315 from Ansa89/trivial-fix

Move makefile into root directory
This commit is contained in:
mannol 2015-03-21 19:25:05 +01:00
commit f8dc82516e
5 changed files with 20 additions and 15 deletions

View File

@ -41,7 +41,6 @@ before_script:
- sudo make install - sudo make install
- cd .. - cd ..
script: script:
- cd build
- make -j2 || make || exit 1 - make -j2 || make || exit 1
notifications: notifications:
email: false email: false

View File

@ -36,7 +36,6 @@ You can omit `libnotify` if you intend to build without desktop notifications en
<a name="Compiling"> <a name="Compiling">
## Compiling ## Compiling
``` ```
cd build/
make PREFIX="/where/to/install" make PREFIX="/where/to/install"
sudo make install PREFIX="/where/to/install" sudo make install PREFIX="/where/to/install"
``` ```

View File

@ -1,4 +1,4 @@
BASE_DIR = $(shell cd .. && pwd -P) BASE_DIR = $(shell pwd -P)
CFG_DIR = $(BASE_DIR)/cfg CFG_DIR = $(BASE_DIR)/cfg
-include $(CFG_DIR)/global_vars.mk -include $(CFG_DIR)/global_vars.mk
@ -49,22 +49,28 @@ endif
# Include all needed checks # Include all needed checks
-include $(CFG_DIR)/checks/check_features.mk -include $(CFG_DIR)/checks/check_features.mk
# Fix path for object files
OBJ := $(addprefix $(BUILD_DIR)/, $(OBJ))
# Targets # Targets
all: toxic all: $(BUILD_DIR)/toxic
toxic: $(OBJ) $(BUILD_DIR)/toxic: $(OBJ)
@echo " LD $@" @echo " LD $(@:$(BUILD_DIR)/%=%)"
@$(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS) @$(CC) $(CFLAGS) -o $(BUILD_DIR)/toxic $(OBJ) $(LDFLAGS)
%.o: $(SRC_DIR)/%.c $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
@echo " CC $@" @if [ ! -e $(BUILD_DIR) ]; then \
@$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c mkdir -p $(BUILD_DIR) ;\
@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d fi
@echo " CC $(@:$(BUILD_DIR)/%=%)"
@$(CC) $(CFLAGS) -o $(BUILD_DIR)/$*.o -c $(SRC_DIR)/$*.c
@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $(BUILD_DIR)/$*.d
clean: clean:
rm -f *.d *.o toxic rm -rf $(BUILD_DIR)
-include $(OBJ:.o=.d) -include $(BUILD_DIR)/$(OBJ:.o=.d)
-include $(CFG_DIR)/targets/*.mk -include $(CFG_DIR)/targets/*.mk

View File

@ -8,6 +8,7 @@ else
endif endif
# Project directories # Project directories
BUILD_DIR = $(BASE_DIR)/build
DOC_DIR = $(BASE_DIR)/doc DOC_DIR = $(BASE_DIR)/doc
SRC_DIR = $(BASE_DIR)/src SRC_DIR = $(BASE_DIR)/src
SND_DIR = $(BASE_DIR)/sounds SND_DIR = $(BASE_DIR)/sounds

View File

@ -1,8 +1,8 @@
# Install target # Install target
install: toxic install: $(BUILD_DIR)/toxic
@echo "Installing toxic executable" @echo "Installing toxic executable"
@mkdir -p $(abspath $(DESTDIR)/$(BINDIR)) @mkdir -p $(abspath $(DESTDIR)/$(BINDIR))
@install -m 0755 toxic $(abspath $(DESTDIR)/$(BINDIR)/toxic) @install -m 0755 $(BUILD_DIR)/toxic $(abspath $(DESTDIR)/$(BINDIR)/toxic)
@echo "Installing desktop file" @echo "Installing desktop file"
@mkdir -p $(abspath $(DESTDIR)/$(APPDIR)) @mkdir -p $(abspath $(DESTDIR)/$(APPDIR))