Makefile (1957B)
1 # Copyright (C) 2015-2018, 2021, 2024 |Méso|Star> (contact@meso-star.com) 2 # 3 # 4 # This program is free software: you can redistribute it and/or modify 5 # it under the terms of the GNU General Public License as published by 6 # the Free Software Foundation, either version 3 of the License, or 7 # (at your option) any later version. 8 # 9 # This program is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 17 .POSIX: 18 .SUFFIXES: # Clean up default inference rules 19 20 include config.mk 21 22 SRC = src/s4vs.c src/s4vs_args.c src/s4vs_realization.c 23 OBJ = $(SRC:.c=.o) 24 DEP = $(SRC:.c=.d) 25 26 # Default target 27 default: build_executable 28 29 build_executable: .config $(DEP) 30 @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) s4vs 31 32 .config: Makefile config.mk 33 $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys 34 $(PKG_CONFIG) --atleast-version $(S3D_VERSION) s3d 35 $(PKG_CONFIG) --atleast-version $(S3DAW_VERSION) s3daw 36 $(PKG_CONFIG) --atleast-version $(SSP_VERSION) star-sp 37 $(PKG_CONFIG) --atleast-version $(SMC_VERSION) smc 38 echo 'config done' > $@ 39 40 $(DEP) $(OBJ): config.mk 41 42 s4vs: $(OBJ) 43 $(CC) $(CFLAGS) $(INCS) -o $@ $(OBJ) $(LDFLAGS) $(LIBS) 44 45 .SUFFIXES: .c .d .o 46 .c.d: 47 @$(CC) $(CFLAGS) $(INCS) -MM -MT "$(@:.d=.o) $@" $< -MF $@ 48 49 .c.o: 50 $(CC) $(CFLAGS) $(INCS) -c $< -o $@ 51 52 clean: 53 rm -f $(OBJ) $(DEP) s4vs .config 54 55 install: build_executable 56 mkdir -p "$(DESTDIR)$(BINDIR)" 57 cp s4vs "$(DESTDIR)$(BINDIR)" 58 chmod 755 "$(DESTDIR)$(BINDIR)/s4vs" 59 mkdir -p "$(DESTDIR)$(MANDIR)/man1" 60 cp s4vs.1 "$(DESTDIR)$(MANDIR)/man1" 61 chmod 644 "$(DESTDIR)$(MANDIR)/man1/s4vs.1" 62 63 uninstall: 64 rm -f "$(DESTDIR)$(BINDIR)/s4vs" 65 rm -f "$(DESTDIR)$(MANDIR)/man1/s4vs.1"