Mail Archives: djgpp/1994/09/09/18:19:56
I found that the difference between making libc with -g and without
-g is 250k (about 2x the size)...
Anyway, I'm using this makefile to make libc...
Once we're using gnu make, we may as well take advantage of it...
The only think is the pattern matches needed to be lower case (don't
know if this is a dos problem...)
I wanted to generate libraries with symbols with/without optimization...
CC=gcc
ODIR=object
# type of library
TYPE=dbo3
OPT=-O3
DEBUG=-g
CFLAGS=$(OPT) $(DEBUG)
DIRS= bios debug str sys go32 locale lib io gen dos
VPATH=$(DIRS)
findcfile = $(subst $(dir)/,,$(wildcard $(dir)/*.c))
# this is strageness on dos
# we have to match .s and treat them as .S
findsfile = $(subst $(dir)/,,$(wildcard $(dir)/*.s))
dirs := go32 io dos debug gen locale lib sys bios
SRCS.c:=$(foreach dir,$(dirs), $(findcfile))
SRCS.S:=$(foreach dir,$(dirs), $(findsfile))
OBJS=$(SRCS.c:.c=.o)
OBJS+=$(SRCS.S:.s=.o)
OBJS:=$(addprefix $(ODIR)/,$(OBJS))
$(ODIR)/libc$(TYPE).a: $(ODIR) $(OBJS)
-@rm $@
ar rs $@ $(ODIR)/*.o
$(ODIR):
mkdir -p $(ODIR)
$(ODIR)/%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
$(ODIR)/%.o: %.s
$(CC) -c -x assembler-with-cpp -o $@ $<
marty
Member of the League of Programming Freedom
leisner AT sdsp DOT mc DOT xerox DOT com leisner AT eso DOT mc DOT xerox DOT com
- Raw text -