mirror of
				https://github.com/Tha14/toxic.git
				synced 2025-11-04 10:26:52 +01:00 
			
		
		
		
	Merge pull request #315 from Ansa89/trivial-fix
Move makefile into root directory
This commit is contained in:
		@@ -41,7 +41,6 @@ before_script:
 | 
			
		||||
  - sudo make install
 | 
			
		||||
  - cd ..
 | 
			
		||||
script:
 | 
			
		||||
  - cd build
 | 
			
		||||
  - make -j2 || make || exit 1
 | 
			
		||||
notifications:
 | 
			
		||||
  email: false
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,6 @@ You can omit `libnotify` if you intend to build without desktop notifications en
 | 
			
		||||
<a name="Compiling">
 | 
			
		||||
## Compiling
 | 
			
		||||
```
 | 
			
		||||
cd build/
 | 
			
		||||
make PREFIX="/where/to/install"
 | 
			
		||||
sudo make install PREFIX="/where/to/install"
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
BASE_DIR = $(shell cd .. && pwd -P)
 | 
			
		||||
BASE_DIR = $(shell pwd -P)
 | 
			
		||||
CFG_DIR = $(BASE_DIR)/cfg
 | 
			
		||||
 | 
			
		||||
-include $(CFG_DIR)/global_vars.mk
 | 
			
		||||
@@ -49,22 +49,28 @@ endif
 | 
			
		||||
# Include all needed checks
 | 
			
		||||
-include $(CFG_DIR)/checks/check_features.mk
 | 
			
		||||
 | 
			
		||||
# Fix path for object files
 | 
			
		||||
OBJ := $(addprefix $(BUILD_DIR)/, $(OBJ))
 | 
			
		||||
 | 
			
		||||
# Targets
 | 
			
		||||
all: toxic
 | 
			
		||||
all: $(BUILD_DIR)/toxic
 | 
			
		||||
 | 
			
		||||
toxic: $(OBJ)
 | 
			
		||||
	@echo "  LD    $@"
 | 
			
		||||
	@$(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS)
 | 
			
		||||
$(BUILD_DIR)/toxic: $(OBJ)
 | 
			
		||||
	@echo "  LD    $(@:$(BUILD_DIR)/%=%)"
 | 
			
		||||
	@$(CC) $(CFLAGS) -o $(BUILD_DIR)/toxic $(OBJ) $(LDFLAGS)
 | 
			
		||||
 | 
			
		||||
%.o: $(SRC_DIR)/%.c
 | 
			
		||||
	@echo "  CC    $@"
 | 
			
		||||
	@$(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c
 | 
			
		||||
	@$(CC) -MM $(CFLAGS) $(SRC_DIR)/$*.c > $*.d
 | 
			
		||||
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
 | 
			
		||||
	@if [ ! -e $(BUILD_DIR) ]; then \
 | 
			
		||||
		mkdir -p $(BUILD_DIR) ;\
 | 
			
		||||
	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:
 | 
			
		||||
	rm -f *.d *.o toxic
 | 
			
		||||
	rm -rf $(BUILD_DIR)
 | 
			
		||||
 | 
			
		||||
-include $(OBJ:.o=.d)
 | 
			
		||||
-include $(BUILD_DIR)/$(OBJ:.o=.d)
 | 
			
		||||
 | 
			
		||||
-include $(CFG_DIR)/targets/*.mk
 | 
			
		||||
 | 
			
		||||
@@ -8,6 +8,7 @@ else
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# Project directories
 | 
			
		||||
BUILD_DIR = $(BASE_DIR)/build
 | 
			
		||||
DOC_DIR = $(BASE_DIR)/doc
 | 
			
		||||
SRC_DIR = $(BASE_DIR)/src
 | 
			
		||||
SND_DIR = $(BASE_DIR)/sounds
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
# Install target
 | 
			
		||||
install: toxic
 | 
			
		||||
install: $(BUILD_DIR)/toxic
 | 
			
		||||
	@echo "Installing toxic executable"
 | 
			
		||||
	@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"
 | 
			
		||||
	@mkdir -p $(abspath $(DESTDIR)/$(APPDIR))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user