Browse Source

updated Makefiles to build in subdirectories

master
Sven Oliver Moll 6 months ago
parent
commit
c94a12f3cc
4 changed files with 25 additions and 15 deletions
  1. +2
    -0
      .gitignore
  2. +13
    -9
      Makefile
  3. +9
    -5
      Makefile.mxe
  4. +1
    -1
      debian/install

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
mxe
obj

+ 13
- 9
Makefile View File

@@ -1,19 +1,23 @@

PROGRAM = makewav

CC = gcc
CFLAGS = -Os -g -Wall
#CFLAGS = -g -Wall
LDFLAGS = -lm -lportaudio
CC := gcc
CFLAGS := -Os -g -Wall
#CFLAGS := -g -Wall
LDFLAGS := -lm -lportaudio
BUILDDIR := obj

all: $(PROGRAM)
all: $(BUILDDIR)/$(PROGRAM)

%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
$(BUILDDIR):
mkdir -p $@

$(PROGRAM): queue.o makewav.o paplay.o streambuffer.o
$(BUILDDIR)/%.o: %.c $(BUILDDIR)
$(CC) $(CFLAGS) -c -o $@ $<

$(BUILDDIR)/$(PROGRAM): $(BUILDDIR)/queue.o $(BUILDDIR)/makewav.o $(BUILDDIR)/paplay.o $(BUILDDIR)/streambuffer.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

clean:
rm -f $(PROGRAM) *.o
rm -rf $(BUILDDIR)


+ 9
- 5
Makefile.mxe View File

@@ -9,18 +9,22 @@ STRIP := $(MXE_DIR)/usr/bin/$(MXE_TARGET)-strip
CFLAGS := -Os
#CFLAGS := -g -Wall
LDFLAGS := -lm -lportaudio -lwinmm -lsetupapi -lhid -lole32
BUILDDIR := mxe

all: $(PROGRAM)
all: $(BUILDDIR)/$(PROGRAM)

%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
$(BUILDDIR):
mkdir -p $@

$(PROGRAM): queue.o makewav.o paplay.o streambuffer.o
$(BUILDDIR)/%.o: %.c $(BUILDDIR)
$(CC) $(CFLAGS) -c -o $@ $<

$(BUILDDIR)/$(PROGRAM): $(BUILDDIR)/queue.o $(BUILDDIR)/makewav.o $(BUILDDIR)/paplay.o $(BUILDDIR)/streambuffer.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
$(STRIP) $@
upx --ultra-brute $@ || :
ls -l $@

clean:
rm -f $(PROGRAM) *.o
rm -rf $(BUILDDIR)


+ 1
- 1
debian/install View File

@@ -1 +1 @@
makewav usr/bin
obj/makewav usr/bin

Loading…
Cancel
Save