Commit 7d34f9ad authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

make libs out of console archives

parent cdbf167c
......@@ -14,7 +14,7 @@ LIBTOOL=libtool
%: %.o
@echo " LD $@"
@${LIBTOOL} --quiet --mode=link --tag=CC $(LINK.o) $^ $(LOADLIBS) $(LDLIBS) $($@_LDFLAGS) -o $@
@${LIBTOOL} --quiet --mode=link --tag=CC $(LINK.o) $(filter %.o,$^) $(LOADLIBS) $(LDLIBS) $($@_LDFLAGS) -o $@
%.lo: %.c
@echo "LT CC $<"
include ../
CFLAGS= -Wall -g -I../../common/utils -I../controller -Iaalib -Ipredictlib -I../../common/trace -I../../common/include -I../../include
ARCHIVES= aalib/aalib.a predictlib/predictlib.a
LDFLAGS+= -L../../common/lib/ -L../../lib/ -lutils -ltrace -static
LDFLAGS+= -L../../common/lib/ -L../../lib/ -L./lib -lutils -ltrace -static
LIBNOVA=-lnova -L../../lib/
......@@ -29,77 +28,79 @@ $(RELEASE_FILE): all
release: $(RELEASE_FILE)
await_controller: await_controller.o $(ARCHIVES)
await_controller: await_controller.o
console_easycomm: console_easycomm.o setpoint.o $(ARCHIVES)
console_easycomm: console_easycomm.o setpoint.o
console_httptrace: console_httptrace.o $(ARCHIVES)
console_httptrace: console_httptrace.o
console_joystick: console_joystick.o setpoint.o $(ARCHIVES)
console_joystick: console_joystick.o setpoint.o
command_shell: command_shell.o setpoint.o $(ARCHIVES)
command_shell: command_shell.o setpoint.o
spg_list: spg_list.o $(ARCHIVES)
spg_list: spg_list.o
spg_log_parser: spg_log_parser.o $(ARCHIVES)
spg_log_parser: spg_log_parser.o
console_moontracker: console_moontracker.o setpoint.o $(ARCHIVES) -lm -lpthread
console_moontracker_LDFLAGS= -lm -lpthread -laa
console_moontracker: console_moontracker.o setpoint.o
console_j2000tracker_LDFLAGS=$(LIBNOVA) -lpthread -lm
console_j2000tracker: console_j2000tracker.o setpoint.o $(ARCHIVES)
console_j2000tracker: console_j2000tracker.o setpoint.o
console_j2000tracer_LDFLAGS=$(LIBNOVA) -lm
console_j2000tracer: console_j2000tracer.o $(ARCHIVES)
console_j2000tracer: console_j2000tracer.o
console_j2000_indi_LDFLAGS= -lindi -lindidriver -lm $(LIBNOVA)
console_j2000_indi: console_j2000_indi.o $(ARCHIVES)
console_j2000_indi: console_j2000_indi.o
console_azel: console_azel.o setpoint.o $(ARCHIVES)
console_azel: console_azel.o setpoint.o
console_manual: console_manual.o setpoint.o $(ARCHIVES)
console_manual: console_manual.o setpoint.o
console_suntracker: console_suntracker.o setpoint.o $(ARCHIVES) -lm -lpthread
console_suntracker_LDFLAGS= -lm -lpthread -laa
console_suntracker: console_suntracker.o setpoint.o
console_idle: console_idle.o setpoint.o $(ARCHIVES)
console_idle: console_idle.o setpoint.o
console_weather: console_weather.o $(ARCHIVES) -lpthread
console_weather: console_weather.o -lpthread
console_zenith: console_zenith.o setpoint.o $(ARCHIVES)
console_zenith: console_zenith.o setpoint.o
trace_proxy: trace_proxy.o $(ARCHIVES)
trace_proxy: trace_proxy.o
trace.cgi: trace.cgi.o $(ARCHIVES)
trace.cgi: trace.cgi.o
trace.cgi_install: trace.cgi
@echo " CP trace.cgi"
@echo " CP trace.cgi"
@cp trace.cgi ../htdocs
trace_log: trace_log.o $(ARCHIVES)
trace_log: trace_log.o
log_proxy: log_proxy.o $(ARCHIVES)
log_proxy: log_proxy.o
spg_auth: spg_auth.o setpoint.o $(ARCHIVES)
spg_auth: spg_auth.o setpoint.o
console_sattracker_LDFLAGS= -lpthread $(LIBNOVA) -lm
console_sattracker: console_sattracker.o setpoint.o $(ARCHIVES)
console_sattracker_LDFLAGS= -lpthread $(LIBNOVA) -lm -lpredict
console_sattracker: console_sattracker.o setpoint.o
command.cgi: command.cgi.o $(ARCHIVES)
command.cgi: command.cgi.o
command.cgi_install: command.cgi
@echo " CP command.cgi"
@echo " CP command.cgi"
@cp command.cgi ../htdocs
shell.cgi: shell.cgi.o $(ARCHIVES)
shell.cgi: shell.cgi.o
shell.cgi_install: shell.cgi
@echo " CP shell.cgi"
@echo " CP shell.cgi"
@cp shell.cgi ../htdocs
status.cgi: status.cgi.o $(ARCHIVES)
status.cgi: status.cgi.o
status.cgi_install: status.cgi
@echo " CP status.cgi"
@echo " CP status.cgi"
@cp status.cgi ../htdocs
......@@ -8,32 +8,36 @@ diurpx.c dms.c epsiln.c fk4fk5.c kepler.c kfiles.c lightt.c lonlat.c \
nutate.c precess.c refrac.c rplanet.c rstar.c sidrlt.c sun.c domoon.c \
trnsit.c vearth.c zatan2.c \
gplan.c mer404.c ven404.c ear404.c mar404.c jup404.c \
sat404.c ura404.c nep404.c plu404.c mlr404.c mlat404.c
sat404.c ura404.c nep404.c plu404.c mlr404.c mlat404.c \
OBJS = $(SRCS:.c=.o)
OBJS = $(SRCS:.c=.lo)
INCS = kep.h plantbl.h
all: libaa.la_install
all: aalib
@mkdir ${CURDIR}/../lib
rm -rf *.o *.a *.d
libaa.la_LDFLAGS= -lm -rpath ${CURDIR}/../lib $(OBJS)
libaa.la_install: ${CURDIR}/../lib
@echo "CP $^ to libdir"
@${LIBTOOL} --quiet --mode=install install ${CURDIR}/../lib
aalib: aalib.a(aa.o $(OBJS))
rm -rf *.o *.a *.d *.lo *.la .libs
# $(AR) -r aalib.a aa.o $(OBJS)
aa: aa.o $(OBJS) $(INCS)
$(CC) -o aa aa.o $(OBJS) -lm
# coff2exe aa
aa.o: aa.c $(INCS)
conjunct: conjunct.o $(OBJS) $(INCS)
$(CC) -o conjunct conjunct.o $(OBJS) -lm
# coff2exe conjunct
conjunct.o: conjunct.c $(INCS)
LIBSRCS=sgp4sdp4.c sgp_in.c sgp_math.c sgp_obs.c sgp_time.c solar.c predictlib.c
TESTSRCS=test-001.c test-002.c
all: predictlib.a test-001 test-002 test-003
all: libpredict.la_install test-001 test-002 test-003
predictlib.a: predictlib.a($(LIBOBJS))
@mkdir ${CURDIR}/../lib
test-001: test-001.o predictlib.a
libpredict.la_LDFLAGS= -lm -rpath ${CURDIR}/../lib $(LIBOBJS)
test-002: test-002.o predictlib.a
libpredict.la_install: ${CURDIR}/../lib
@echo "CP $^ to libdir"
@${LIBTOOL} --quiet --mode=install install ${CURDIR}/../lib
test-003: test-003.o predictlib.a
test-001_LDFLAGS= -lpredict
test-001: test-001.o libpredict.la_install
test-002_LDFLAGS= -lpredict
test-002: test-002.o libpredict.la_install
test-003_LDFLAGS= -lpredict
test-003: test-003.o libpredict.la_install
rm -rf *.o *.a *.d test-001 test-002
rm -rf *.o *.a *.d test-001 test-002 test-003 *.lo *.la libs
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment